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 }) { export default function webpackBaseConfig ({ isClient, isServer }) {
const nodeModulesDir = join(__dirname, '..', 'node_modules') const nodeModulesDir = join(__dirname, '..', 'node_modules')
/* istanbul ignore if */ // Enable autoprefixer if both autoprefixer postcss are enabled
if (!Array.isArray(this.options.build.postcss)) { if (this.options.build.autoprefixer && Array.isArray(this.options.build.postcss)) {
this.options.build.postcss = [ this.options.build.postcss.push(autoprefixer(this.options.build.autoprefixer))
autoprefixer({
browsers: ['last 3 versions']
})
]
} }
const config = { const config = {

View File

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