webpack2 vue-cli autoprefixer not work in js file when require scss file?

寵の児 提交于 2020-01-17 10:59:46

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!