报错信息

ERROR in ./node_modules/extract-text-webpack-plugin/dist/loader.js?{"omit":1,"remove":true}!./node_modules/vue-style-loader!./node_modules/css-loader?{"minimize":true,"sourceMap":false}!./node_modules/vue-loader/lib/style-compiler?{"optionsId":"0","vue":true,"id":"data-v-05e980da","scoped":true,"sourceMap":false}!./node_modules/sass-loader/dist/cjs.js?{"sourceMap":false}!./node_modules/sass-resources-loader/lib/loader.js?{"resources":["/src/style/function.scss"]}!./node_modules/vue-loader/lib/selector.js?type=styles&index=0!./src/components/search/trackList.vue
Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example
at Object.pitch

在使用extract-text-webpack-plugin插件遇到了问题,在开发环境编译没问题,在生产环境编译出问题了,

cross-env NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.client.conf.js

经代码排查,发现是缺少使用ExtractTextPlugin注入到某个地址里面去

if (process.env.NODE_ENV === 'production') {
clientConf.plugins.push(
new ExtractTextPlugin({
filename: utils.assetsPath('css/[name].[contenthash].css')
})
)
}

之前只是在utils函数里面有这个使用

 return ExtractTextPlugin.extract({
use: loaders,
fallback: 'vue-style-loader'
})

缺少在webpack.client.conf.js使用