debug: Show what PostCSS configuration is used

This commit is contained in:
Atinux 2017-11-03 12:31:12 +01:00
parent 42073db289
commit ac3b3f27a7

View File

@ -1,8 +1,12 @@
import _ from 'lodash'
import Debug from 'debug'
import { join, resolve } from 'path'
import { existsSync } from 'fs'
import { isUrl, isPureObject } from 'utils'
const debug = Debug('nuxt:build')
debug.color = 2 // Force green color
const Options = {}
export default Options
@ -96,6 +100,7 @@ Options.from = function (_options) {
// Default postcss options
if (postcssConfigPath) {
debug(`Using PostCSS config file: ${postcssConfigPath}`)
options.build.postcss = {
sourceMap: options.build.cssSourceMap,
// https://github.com/postcss/postcss-loader/blob/master/lib/index.js#L79
@ -104,6 +109,7 @@ Options.from = function (_options) {
}
}
} else {
debug('Using PostCSS config from `build.postcss`')
// Normalize & Apply default plugins
if (Array.isArray(options.build.postcss)) {
options.build.postcss = { plugins: options.build.postcss }