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

fix: bootstrap failures #2187

Merged
merged 2 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion webapp/internals/webpack/webpack.base.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ module.exports = options => ({
},
{
test: /\.js$/, // Transform all .js files required somewhere with Babel
use: 'happypack/loader?id=js'
exclude: [
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是否可以直接使用: exclude: /node_modules/

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个我也考虑过,davinci 依赖比较多,直接这样改的话,假设有些库没有按照标准实现或者直接使用 ES6/7 的特性,那就会有很多问题了

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本人前端小白,最近也在看这个问题,之前定位到了core-js,目前只把core-js exclude是也是可以的~ 这样做是否可行呢?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可行的,corejs 是标准库,不需要二次 babel

/\bcore-js\b/,
/\bwebpack\/buildin\b/
],
use: 'happypack/loader?id=js',
},
{
// Do not transform vendor's CSS with CSS-modules
Expand Down
2 changes: 1 addition & 1 deletion webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"build:prod": "cross-env NODE_ENV=production webpack --config internals/webpack/webpack.dv.babel.js --color -p --progress --hide-modules --display-optimization-bailout",
"build": "cross-env NODE_ENV=production webpack --config internals/webpack/webpack.prod.babel.js --color -p --progress --hide-modules --display-optimization-bailout",
"build:clean": "rimraf ./build",
"start": "cross-env NODE_ENV=development node server",
"start": "cross-env NODE_ENV=development node --max-old-space-size=3072 server",
"start:production": "npm run test && npm run build && npm run start:prod",
"start:prod": "cross-env NODE_ENV=production node server",
"clean:all": "npm run analyze:clean && npm run test:clean && npm run build:clean",
Expand Down