zoukankan      html  css  js  c++  java
  • The 'mode' option has not been set, webpack will fallback to 'production' for th is value

    1、错误描述

    C:UsersAdministrator>cd cma
    
    C:UsersAdministratorcma>webpack you.js today.js
    Hash: 39919aae8cb041a7549f
    Version: webpack 4.10.2
    Time: 588ms
    Built at: 2018-06-01 21:01:06
     1 asset
    Entrypoint main = main.js
    [0] ./you.js 288 bytes {0} [built]
    [1] multi ./you.js today.js 40 bytes {0} [built]
    
    WARNING in configuration
    The 'mode' option has not been set, webpack will fallback to 'production' for th
    is 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/
    
    ERROR in multi ./you.js today.js
    Module not found: Error: Can't resolve 'today.js' in 'C:UsersAdministratorcma
    '
     @ multi ./you.js today.js
    
    C:UsersAdministratorcma>webpack you.js today.js
    Hash: 2ffa3d7e0a8a6e808dda
    Version: webpack 4.10.2
    Time: 613ms
    Built at: 2018-06-01 21:11:11
      Asset     Size  Chunks             Chunk Names
    main.js  1.1 KiB       0  [emitted]  main
    Entrypoint main = main.js
    [0] ./today.js 0 bytes {0} [built]
    [1] ./you.js 288 bytes {0} [built]
    [2] multi ./you.js ./today.js 40 bytes {0} [built]
    
    WARNING in configuration
    The 'mode' option has not been set, webpack will fallback to 'production' for th
    is 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/
    
    C:UsersAdministratorcma>webpack you.js today.js
    Hash: 2ffa3d7e0a8a6e808dda
    Version: webpack 4.10.2
    Time: 156ms
    Built at: 2018-06-01 21:13:04
      Asset     Size  Chunks             Chunk Names
    main.js  1.1 KiB       0  [emitted]  main
    Entrypoint main = main.js
    [0] ./today.js 0 bytes {0} [built]
    [1] ./you.js 288 bytes {0} [built]
    [2] multi ./you.js ./today.js 40 bytes {0} [built]
    
    WARNING in configuration
    The 'mode' option has not been set, webpack will fallback to 'production' for th
    is 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/
    
    C:UsersAdministratorcma>

    2、错误原因

         没有设置webpack的模式,是生产还是开发(production or development)


    3、解决办法

         执行命令:webpack --mode=production或者webpack --mode=development

    C:UsersAdministrator>webpack --mode=production
    Hash: 68029a5423f50b49c81f
    Version: webpack 4.10.2
    Time: 91ms
    Built at: 2018-06-01 21:18:40
    
    ERROR in Entry module not found: Error: Can't resolve './src' in 'C:UsersAdmin
    istrator'
    
    C:UsersAdministrator>

  • 相关阅读:
    2017-2018-2 20179225《网络攻防与实践》 第5周作业
    NetSec2019 20165327 Exp3 免杀原理与实践
    NetSec2019 20165327 Exp2 后门原理与实践
    NetSec2019 20165327 Exp1 PC平台逆向破解
    NetSec2019 20165327 Exp0 Kali安装 Week1
    实验五 通讯协议设计
    2018-2019-1 20165307 20165327 20165332 实验四 外设驱动程序设计
    2018-2019-1 20165327 《信息安全系统设计基础》第八周学习总结
    实现mypwd&mybash&myod&读者写者
    2018-2019-1 20165327 实验三 实时系统
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13313781.html
Copyright © 2011-2022 走看看