mirror of
https://github.com/nuxt/nuxt.git
synced 2024-12-02 18:37:21 +00:00
debug: Show what PostCSS configuration is used
This commit is contained in:
parent
42073db289
commit
ac3b3f27a7
@ -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 }
|
||||||
|
Loading…
Reference in New Issue
Block a user