From 1f4dfa5f4485e00263fdaf1e83a3b1db438030fa Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Sat, 5 Aug 2017 12:37:33 +0430 Subject: [PATCH] feat: build.autoprefixer option allows enable/disable or customize autoprefixer closes #1296 --- lib/builder/webpack/base.config.js | 10 +++------- lib/common/options.js | 5 ++++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/builder/webpack/base.config.js b/lib/builder/webpack/base.config.js index d77edc9d8d..c715f59922 100644 --- a/lib/builder/webpack/base.config.js +++ b/lib/builder/webpack/base.config.js @@ -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 = { diff --git a/lib/common/options.js b/lib/common/options.js index 8e784da5b9..3a33275a95 100755 --- a/lib/common/options.js +++ b/lib/common/options.js @@ -115,7 +115,10 @@ Options.defaults = { vendor: [], plugins: [], babel: {}, - postcss: undefined, + autoprefixer: { + browsers: ['last 3 versions'] + }, + postcss: [], templates: [], watch: [], devMiddleware: {},