install polyfill & runtime to dependency instead of devDependency [skip ci] (#9409)

This commit is contained in:
Rizky 2019-01-30 01:09:08 +11:00 committed by Brian Ng
parent 828169e611
commit 56044c7851
4 changed files with 13 additions and 10 deletions

View File

@ -1,19 +1,19 @@
# @babel/plugin-class-features # @babel/helper-create-class-features-plugin
> Compile class public and private fields, private methods and decorators to ES6 > Compile class public and private fields, private methods and decorators to ES6
See our website [@babel/plugin-class-features](https://babeljs.io/docs/en/next/babel-plugin-class-features.html) for more information. See our website [@babel/helper-create-class-features-plugin](https://babeljs.io/docs/en/next/babel-helper-create-class-features-plugin.html) for more information.
## Install ## Install
Using npm: Using npm:
```sh ```sh
npm install --save-dev @babel/plugin-class-features npm install --save-dev @babel/helper-create-class-features-plugin
``` ```
or using yarn: or using yarn:
```sh ```sh
yarn add @babel/plugin-class-features --dev yarn add @babel/helper-create-class-features-plugin --dev
``` ```

View File

@ -9,11 +9,11 @@ See our website [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill
Using npm: Using npm:
```sh ```sh
npm install --save-dev @babel/polyfill npm install --save @babel/polyfill
``` ```
or using yarn: or using yarn:
```sh ```sh
yarn add @babel/polyfill --dev yarn add @babel/polyfill
``` ```

View File

@ -9,11 +9,11 @@ See our website [@babel/runtime](https://babeljs.io/docs/en/next/babel-runtime.h
Using npm: Using npm:
```sh ```sh
npm install --save-dev @babel/runtime npm install --save @babel/runtime
``` ```
or using yarn: or using yarn:
```sh ```sh
yarn add @babel/runtime --dev yarn add @babel/runtime
``` ```

View File

@ -13,12 +13,15 @@ const cwd = process.cwd();
const packageDir = join(cwd, "packages"); const packageDir = join(cwd, "packages");
const packages = readdirSync(packageDir); const packages = readdirSync(packageDir);
const packagesInstalledToDep = ["@babel/polyfill", "@babel/runtime"];
const getWebsiteLink = n => `https://babeljs.io/docs/en/next/${n}.html`; const getWebsiteLink = n => `https://babeljs.io/docs/en/next/${n}.html`;
const getPackageJson = pkg => require(join(packageDir, pkg, "package.json")); const getPackageJson = pkg => require(join(packageDir, pkg, "package.json"));
const getIssueLabelLink = l => const getIssueLabelLink = l =>
`https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22${encodeURIComponent( `https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22${encodeURIComponent(
l l
)}%22+is%3Aopen`; )}%22+is%3Aopen`;
const getNpmInstall = name => `npm install ${packagesInstalledToDep.includes(name) ? "--save" : "--save-dev"} ${name}`;
const getYarnAdd = name => `yarn add ${name} ${packagesInstalledToDep.includes(name) ? "" : "--dev"}`;
const labels = { const labels = {
"babel-preset-flow": getIssueLabelLink("area: flow"), "babel-preset-flow": getIssueLabelLink("area: flow"),
@ -54,13 +57,13 @@ See our website [${name}](${websiteLink}) for more information${
Using npm: Using npm:
\`\`\`sh \`\`\`sh
npm install --save-dev ${name} ${getNpmInstall(name)}
\`\`\` \`\`\`
or using yarn: or using yarn:
\`\`\`sh \`\`\`sh
yarn add ${name} --dev ${getYarnAdd(name)}
\`\`\` \`\`\`
`; `;