fix: warn when using array postcss configuration (#4936)

This commit is contained in:
Alexander Lichter 2019-02-03 22:21:51 +00:00 committed by Pooya Parsa
parent efc2880829
commit 422155ea14

View File

@ -1,5 +1,6 @@
import fs from 'fs' import fs from 'fs'
import path from 'path' import path from 'path'
import consola from 'consola'
import defaults from 'lodash/defaults' import defaults from 'lodash/defaults'
import merge from 'lodash/merge' import merge from 'lodash/merge'
import cloneDeep from 'lodash/cloneDeep' import cloneDeep from 'lodash/cloneDeep'
@ -93,7 +94,10 @@ export default class PostcssConfig {
} }
normalize(config) { normalize(config) {
// TODO: Remove in Nuxt 3
if (Array.isArray(config)) { if (Array.isArray(config)) {
consola.warn('Using an Array as `build.postcss` will be deprecated in Nuxt 3. Please switch to the object' +
' declaration')
config = { plugins: config } config = { plugins: config }
} }
return config return config