feat: build.autoprefixer option

allows enable/disable or customize autoprefixer

closes #1296
This commit is contained in:
Pooya Parsa 2017-08-05 12:37:33 +04:30
parent e9b66c2e41
commit 1f4dfa5f44
2 changed files with 7 additions and 8 deletions

View File

@ -18,13 +18,9 @@ import { styleLoader, extractStyles } from './helpers'
export default function webpackBaseConfig ({ isClient, isServer }) {
const nodeModulesDir = join(__dirname, '..', 'node_modules')
/* istanbul ignore if */
if (!Array.isArray(this.options.build.postcss)) {
this.options.build.postcss = [
autoprefixer({
browsers: ['last 3 versions']
})
]
// Enable autoprefixer if both autoprefixer postcss are enabled
if (this.options.build.autoprefixer && Array.isArray(this.options.build.postcss)) {
this.options.build.postcss.push(autoprefixer(this.options.build.autoprefixer))
}
const config = {

View File

@ -115,7 +115,10 @@ Options.defaults = {
vendor: [],
plugins: [],
babel: {},
postcss: undefined,
autoprefixer: {
browsers: ['last 3 versions']
},
postcss: [],
templates: [],
watch: [],
devMiddleware: {},