问题
I use vue-cli, which depends on webpack2. I know vue-loader can compile .vue file, it can compile scss&autoprefixer successfully in .vue file, but when I use require .scss file in a js file, autoprefixer does not work, how can i solve it?
I have try this(vue-loader.conf.js) but it does not work:
module.exports = {
loaders: utils.cssLoaders({
sourceMap: isProduction
? config.build.productionSourceMap
: config.dev.cssSourceMap,
extract: isProduction
}),
postcss: [
require('autoprefixer')({
browsers: ['last 7 versions']
})
]
}
来源:https://stackoverflow.com/questions/44029235/webpack2-vue-cli-autoprefixer-not-work-in-js-file-when-require-scss-file