繁体   English   中英

引导程序的Webpack构建错误

[英]Webpack build error for bootstrap

当我继续进行构建时,会出现以下“警告”。 我该如何解决?

除了“ $ 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/
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/

可以通过添加--mode生产(或开发)来解决此错误,具体取决于您要定位的环境。 或者,您也可以放上Webpack配置:

{
  mode: "development"
  ...
}

其他只是提示,为了使您的应用程序更好,可以根据需要忽略它们,也可以通过将其添加到webpack配置中来禁用它:

performance: {hints: false}

要将其添加到命令行中,请编辑package.json并使用webpack将此alogside添加:

webpack --mode development

要让Webpack监视更改:

webpack --mode development --watch

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM