webpack版本与extract-text-webpack-plugin版本不兼容导致的npm run build运行时报错

查了是由于extract-text-webpack-plugin该组件不支持webpack4.x以上版本导致。放弃使用extract-text-webpack-plugin可以解决

我的webpack.config.js:

{
  "name": "gnhhc",
  "version": "1.0.0",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "cross-env NODE_EW=production webpack --config webpack.config.js",
    "dev": "cross-env NODE_EW=development webpack-dev-server --config webpack.config.js"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "autoprefixer": "^9.7.4",
    "babel": "^6.23.0",
    "babel-core": "^6.26.3",
    "babel-loader": "^7.1.5",
    "cross-env": "^7.0.1",
    "css-loader": "^3.4.2",
    "eslint": "^6.8.0",
    "eslint-plugin-vue": "^6.2.1",
    "extract-text-webpack-plugin": "^3.0.2",
    "file-loader": "^5.1.0",
    "html-webpack-plugin": "^3.2.0",
    "postcss-loader": "^3.0.0",
    "style-loader": "^1.1.3",
    "stylus": "^0.54.7",
    "stylus-loader": "^3.0.2",
    "url-loader": "^3.0.0",
    "vue": "^2.6.11",
    "vue-loader": "^15.9.0",
    

你可能感兴趣的:(前端,vue.js,npm,node.js)