diff --git a/packages/babel-preset-env/src/normalize-options.js b/packages/babel-preset-env/src/normalize-options.js index 84ebf85300d0..0f730afabaea 100644 --- a/packages/babel-preset-env/src/normalize-options.js +++ b/packages/babel-preset-env/src/normalize-options.js @@ -160,7 +160,7 @@ export function normalizeCoreJSOption( if (useBuiltIns && corejs === undefined) { rawVersion = 2; console.warn( - "\nWARNING: We noticed you're using the `useBuiltIns` option without declaring a " + + "\nWARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a " + "core-js version. Currently, we assume version 2.x when no version " + "is passed. Since this default version will likely change in future " + "versions of Babel, we recommend explicitly setting the core-js version " + @@ -170,7 +170,9 @@ export function normalizeCoreJSOption( "`dependencies` section. If it doesn't, you need to run one of the " + "following commands:\n\n" + " npm install --save core-js@2 npm install --save core-js@3\n" + - " yarn add core-js@2 yarn add core-js@3\n", + " yarn add core-js@2 yarn add core-js@3\n\n" + + "More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins\n" + + "More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs", ); } else if (typeof corejs === "object" && corejs !== null) { rawVersion = corejs.version; @@ -183,7 +185,7 @@ export function normalizeCoreJSOption( if (!useBuiltIns && version) { console.log( - "\nThe `corejs` option only has an effect when the `useBuiltIns` option is not `false`\n", + "\nWARNING (@babel/preset-env): The `corejs` option only has an effect when the `useBuiltIns` option is not `false`\n", ); } diff --git a/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/stdout.txt b/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/stdout.txt index 4e9aa05982c7..be9ded09f82e 100644 --- a/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/stdout.txt +++ b/packages/babel-preset-env/test/fixtures/debug/corejs-without-usebuiltins/stdout.txt @@ -1,4 +1,4 @@ -The `corejs` option only has an effect when the `useBuiltIns` option is not `false` +WARNING (@babel/preset-env): The `corejs` option only has an effect when the `useBuiltIns` option is not `false` @babel/preset-env: `DEBUG` option diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stderr.txt index dbee5e8f3eb3..2bcc7b0c305b 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stderr.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-no-import/stderr.txt @@ -1,6 +1,9 @@ -WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. +WARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands: npm install --save core-js@2 npm install --save core-js@3 - yarn add core-js@2 yarn add core-js@3 \ No newline at end of file + yarn add core-js@2 yarn add core-js@3 + +More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins +More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stderr.txt index dbee5e8f3eb3..2bcc7b0c305b 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stderr.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-shippedProposals/stderr.txt @@ -1,6 +1,9 @@ -WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. +WARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands: npm install --save core-js@2 npm install --save core-js@3 - yarn add core-js@2 yarn add core-js@3 \ No newline at end of file + yarn add core-js@2 yarn add core-js@3 + +More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins +More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stderr.txt index dbee5e8f3eb3..2bcc7b0c305b 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stderr.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs-uglify/stderr.txt @@ -1,6 +1,9 @@ -WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. +WARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands: npm install --save core-js@2 npm install --save core-js@3 - yarn add core-js@2 yarn add core-js@3 \ No newline at end of file + yarn add core-js@2 yarn add core-js@3 + +More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins +More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stderr.txt index dbee5e8f3eb3..2bcc7b0c305b 100644 --- a/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stderr.txt +++ b/packages/babel-preset-env/test/fixtures/debug/entry-no-corejs/stderr.txt @@ -1,6 +1,9 @@ -WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. +WARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands: npm install --save core-js@2 npm install --save core-js@3 - yarn add core-js@2 yarn add core-js@3 \ No newline at end of file + yarn add core-js@2 yarn add core-js@3 + +More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins +More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stderr.txt index d9061acb2c57..f7b27dd07f70 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stderr.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-1/stderr.txt @@ -1,6 +1,9 @@ -WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. +WARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands: npm install --save core-js@2 npm install --save core-js@3 yarn add core-js@2 yarn add core-js@3 + +More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins +More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stderr.txt index d9061acb2c57..2bcc7b0c305b 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stderr.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-2/stderr.txt @@ -1,6 +1,9 @@ -WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. +WARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands: npm install --save core-js@2 npm install --save core-js@3 yarn add core-js@2 yarn add core-js@3 + +More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins +More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stderr.txt index dbee5e8f3eb3..2bcc7b0c305b 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stderr.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-1/stderr.txt @@ -1,6 +1,9 @@ -WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. +WARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands: npm install --save core-js@2 npm install --save core-js@3 - yarn add core-js@2 yarn add core-js@3 \ No newline at end of file + yarn add core-js@2 yarn add core-js@3 + +More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins +More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs \ No newline at end of file diff --git a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stderr.txt b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stderr.txt index dbee5e8f3eb3..2bcc7b0c305b 100644 --- a/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stderr.txt +++ b/packages/babel-preset-env/test/fixtures/debug/usage-no-corejs-none-2/stderr.txt @@ -1,6 +1,9 @@ -WARNING: We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. +WARNING (@babel/preset-env): We noticed you're using the `useBuiltIns` option without declaring a core-js version. Currently, we assume version 2.x when no version is passed. Since this default version will likely change in future versions of Babel, we recommend explicitly setting the core-js version you are using via the `corejs` option. You should also be sure that the version you pass to the `corejs` option matches the version specified in your `package.json`'s `dependencies` section. If it doesn't, you need to run one of the following commands: npm install --save core-js@2 npm install --save core-js@3 - yarn add core-js@2 yarn add core-js@3 \ No newline at end of file + yarn add core-js@2 yarn add core-js@3 + +More info about useBuiltIns: https://babeljs.io/docs/en/babel-preset-env#usebuiltins +More info about core-js: https://babeljs.io/docs/en/babel-preset-env#corejs \ No newline at end of file