zoukankan      html  css  js  c++  java
  • 使用vue.js常见错误之一

    打包项目时,在vscode中输入如下命令

    webpack .srcmain.js .distundle.js

    出现如下错误:

    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/

    ERROR in multi ./src/main.js ./dist/bundle.js
    Module not found: Error: Can't resolve '.distundle.js' in 'E:Vue相关练习webpack-study'
    @ multi ./src/main.js ./dist/bundle.js main[1]

    因为这是老版本,而在webpack4之后 官方对 webpack-cli 单独抽离了出来 所以我们需要做如下步骤方可成功

    1. 安装webpack

    npm i webpack -g
    2. 安装 cli

    npm i -g webpack-cli
    3. 打包 将 main.js bundle.js 替换了就可以

    npx webpack main.js --output-filename bundle.js  --output-path . --mode development

  • 相关阅读:
    写优先
    生产者消费者信号量的个人理解
    向上过滤
    操作系统之进程调度算法笔记
    idea学习
    计算机网络之网络层
    rest-framework routers
    rest framework ViewSet
    rest framework Genericview
    rest framework Views
  • 原文地址:https://www.cnblogs.com/zylstu/p/10544813.html
Copyright © 2011-2022 走看看