【发布时间】:2018-12-26 06:05:47
【问题描述】:
当我开始构建时,会出现以下“警告”。 我该如何解决这个问题?
除了“$ npm run build”之外,还有没有实时构建的命令? 例如)$ sass --watch
或实时预览
$ npm run build
> bootstrap-webpack@1.0.0 build /Users/suk/myweb
> webpack
Hash: 62314a5e1bd8f234994f
Version: webpack 4.16.1
Time: 7100ms
Built at: 2018-07-18 19:27:20
Asset Size Chunks Chunk Names
bundle.js 328 KiB 0 [emitted] [big] main
[0] ./src/app.js 45 bytes {0} [built]
[4] (webpack)/buildin/global.js 489 bytes {0} [built]
[5] ./src/scss/app.scss 1.35 KiB {0} [built]
[6] ./node_modules/css-loader!./node_modules/postcss-loader/lib??ref--4-2!./node_modules/sass-loader/lib/loader.js!./src/scss/app.scss 165 KiB {0} [built]
+ 6 hidden modules
WARNING in configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/concepts/mode/
WARNING in asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
bundle.js (328 KiB)
WARNING in entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
main (328 KiB)
bundle.js
WARNING in webpack performance recommendations:
You can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.
For more info visit https://webpack.js.org/guides/code-splitting/
【问题讨论】:
-
请注意(用于 --watch):webpack.js.org/guides/development。您可以指示 webpack “监视”依赖关系图中的所有文件以进行更改。如果这些文件之一被更新,代码将被重新编译,因此您不必手动运行完整的构建。
标签: node.js web npm webpack bootstrap-4