• Module not found: Error: Can't resolve 'bundle.js' in...


    $ npm run build
    
    > simple-app-demo@1.0.0 build D:workgitsimple-app-demo
    > webpack app.js bundle.js
    
    Hash: af174d80108e932cdc49
    Version: webpack 4.29.3
    Time: 319ms
    Built at: 2019-02-15 10:52:12
     1 asset
    Entrypoint main = main.js
    [0] multi ./app.js bundle.js 40 bytes {0} [built]
    [1] ./app.js 60 bytes {0} [built]
        + 1 hidden module
    
    WARNING in configuration
    The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'p    roduction' 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 ./app.js bundle.js
    Module not found: Error: Can't resolve 'bundle.js' in 'D:workgitsimple-app-demo'
     @ multi ./app.js bundle.js main[1]
    npm ERR! code ELIFECYCLE
    npm ERR! errno 2
    npm ERR! simple-app-demo@1.0.0 build: `webpack app.js bundle.js`
    npm ERR! Exit status 2
    npm ERR!
    npm ERR! Failed at the simple-app-demo@1.0.0 build script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     D:Users\AppDataRoaming
    pm-cache\_logs2019-02-15T02_52_12_529Z-debug.log

    执行webpack打包的时候报错如上,解决方法:

    把package.json里面的scripts命令修改为:

    "build": "webpack app.js -o bundle.js",
  • 相关阅读:
    javascript 常见的面试题---数组 && 算法
    JavaScript内置一些方法的实现原理--new关键字,call/apply/bind方法--实现
    javascript 数组排序原理的简单理解
    随笔2
    移动端触摸事件
    前端开发模式的思考层面
    webpack & react项目搭建一:环境
    Webpack的学习
    《Soft Skills: the software developer's life manual》
    前端路由实现
  • 原文地址:https://www.cnblogs.com/fe-cherrydlh/p/10382444.html
Copyright © 2020-2023  润新知