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