Skip to content

how to enable the css autoprefix function in webpack.dev.config and webpack.prod.config #431

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mytxzz opened this issue Apr 7, 2017 · 1 comment

Comments

@mytxzz
Copy link

mytxzz commented Apr 7, 2017

how to enable the css autoprefix function in webpack.dev.config and webpack.prod.config?

I try to add the following to the vue-loader.conf.js file

module.exports = {
  loaders: utils.cssLoaders({
    sourceMap: isProduction
      ? config.build.productionSourceMap
      : config.dev.cssSourceMap,
    extract: isProduction
  }),
  postcss: [
     require('postcss-cssnext')({
       browsers: ['last 20 versions']
     })
   ]
}

my pakage.json file :

   "webpack": "^2.2.1",
   "postcss-cssnext": "^2.10.0",
   "postcss-loader": "^1.3.3",

when I exec the npm run dev ,no autoprefix in the flex and transform css attrs

thank you very much if anyone can help me

@posva
Copy link
Member

posva commented Apr 7, 2017

Please ask questions on the forum or StackOverflow.

Maybe last 20 versions is not valid (it's quite unrealistic too). Try something like last 2 versions ie >= 9. You should look up css-next doc for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants