Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if set useBuiltIns: 'usage',then error is come #927

Open
summerjean opened this issue Jan 17, 2022 · 0 comments
Open

if set useBuiltIns: 'usage',then error is come #927

summerjean opened this issue Jan 17, 2022 · 0 comments

Comments

@summerjean
Copy link

summerjean commented Jan 17, 2022

Webpack Version:
4.9.1

Babel Core Version:
7.16.7

Babel Loader Version:
8.2.3

Please tell us about your environment:
Windows 10

Current behavior:
if set useBuiltIns: 'usage',then error is come:
{
test: /.js$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env',
{
targets: {
chrome: '60',
firefox: '60',
ie: '9',
safari: '10',
edge: '17'
},
useBuiltIns: 'usage',
corejs:3,
},
]
],
plugins:[
'@babel/plugin-transform-runtime',
]
}
}
},

Expected/desired behavior:
E:\webpack\src\js\test.js
1:1 error 'core-js' should be listed in the project's dependencies, not devDependencies import/no-extraneous-dependencies
1:8 error Unexpected use of file extension "js" for "core-js/modules/es.object.to-string.js" import/extensions
2:1 error 'core-js' should be listed in the project's dependencies, not devDependencies import/no-extraneous-dependencies
2:8 error Unexpected use of file extension "js" for "core-js/modules/es.promise.js" import/extensions
3:1 error 'core-js' should be listed in the project's dependencies, not devDependencies import/no-extraneous-dependencies
3:8 error Unexpected use of file extension "js" for "core-js/modules/web.timers.js" import/extensions
13:5 warning Unexpected console statement no-console
17:1 warning Unexpected console statement no-console

✖ 8 problems (6 errors, 2 warnings)

my package.json is:
"devDependencies": {
"@babel/core": "^7.16.7",
"@babel/plugin-transform-runtime": "^7.16.8",
"@babel/polyfill": "^7.12.1",
"@babel/preset-env": "^7.16.8",
"babel-loader": "^8.2.3",
"core-js": "^3.20.3",
"css-loader": "^6.5.1",
"css-minimizer-webpack-plugin": "^3.3.1",
"eslint": "^7.32.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.25.4",
"file-loader": "^6.2.0",
"html-loader": "^3.1.0",
"html-webpack-plugin": "^5.5.0",
"mini-css-extract-plugin": "^2.4.7",
"postcss-loader": "^6.2.1",
"postcss-preset-env": "^7.2.3",
"style-loader": "^3.3.1",
"url-loader": "^4.1.1",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.7.3"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant