Skip to content

Commit

Permalink
Merge pull request #1035 from drazik/show-config-regexp
Browse files Browse the repository at this point in the history
feat(cozy-scripts): Show regexp when using --show-config flag
  • Loading branch information
CPatchane committed Jan 7, 2019
2 parents 68a1d08 + 4b3504d commit 7302ae9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/cozy-scripts/bin/cozy-scripts.js
Expand Up @@ -6,6 +6,7 @@ const commander = require('commander')
const pkg = require('../package.json')
const colorize = require('../utils/_colorize.js')
const CTS = require('../utils/constants.js')
const regexpReplacer = require('../utils/regexpReplacer')
const getWebpackConfigs = require('../scripts/config')

let actionName
Expand Down Expand Up @@ -86,7 +87,7 @@ const options = {
})

if (program.showConfig) {
console.log(JSON.stringify(getWebpackConfigs(options), null, 2))
console.log(JSON.stringify(getWebpackConfigs(options), regexpReplacer, 2))
} else {
const availableScripts = [
'build',
Expand Down
7 changes: 7 additions & 0 deletions packages/cozy-scripts/utils/regexpReplacer.js
@@ -0,0 +1,7 @@
module.exports = function regexpReplacer(key, value) {
if (value instanceof RegExp) {
return value.toString()
}

return value
}

0 comments on commit 7302ae9

Please sign in to comment.