mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-13 09:33:54 +00:00
feat: build.autoprefixer option
allows enable/disable or customize autoprefixer closes #1296
This commit is contained in:
parent
e9b66c2e41
commit
1f4dfa5f44
@ -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 = {
|
||||||
|
@ -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: {},
|
||||||
|
Loading…
Reference in New Issue
Block a user