zoukankan      html  css  js  c++  java
  • webpack打包配置中出现的问题

    第一个错误:

    One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:

    We will use "npm" to install the CLI via "npm install -D".
    Which one do you like to install (webpack-cli/webpack-command):

    解决方法:npm install webpack-cli -g (升级为wekpack需要再安装webpack-cli)

    第二个人错误:

    解决方法:出现这个错误提示并不是我们环境装错了,而是webpack4 更新后对webpack语法进行了更严格的要求

    之前的命令被修订为 npm webpack a.js --output-filename bundle.js --output-path . --mode development 

    第三个错误:

    解决方法:webpack.config.js里面module里面的loaders改成rules

    module.exports = {
    entry: "./runoob1.js",
    output: {
    path: __dirname,
    filename: "bundle.js"
    },
    module: {
    rules: [//原来是loaders
    { test: /.css$/, loader: "style-loader!css-loader" }
    ]
    }
    };


  • 相关阅读:
    iView
    JS
    JS
    JS
    Java
    Java
    Java
    Java
    Java
    Java
  • 原文地址:https://www.cnblogs.com/binmengxue/p/9407420.html
Copyright © 2011-2022 走看看