vue 报错 "extract-text-webpack-plugin"

问题描述:
将本地node项目部署到其他node环境中时,提示错误
Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin

解决方法:
webpack.dev.conf.js 中添加 extract-text-webpack-plugin 配置

const ExtractTextPlugin = require('extract-text-webpack-plugin')

plugins: [
    .............
    new ExtractTextPlugin({
      filename: utils.assetsPath('css/[name].[contenthash].css'),
      allChunks: false,
    }),
  ]

重新 npm run dev 就成功运行了


本文转载自:https://www.jianshu.com/p/f11f773fb3ac

你可能感兴趣的:(vue 报错 "extract-text-webpack-plugin")