1
1
mirror of https://github.com/c8r/x0.git synced 2024-09-11 13:45:52 +03:00

Add debug flag

This commit is contained in:
Brent Jackson 2018-05-21 23:58:57 -04:00
parent f35b536a7c
commit 5a3703c7f8
3 changed files with 12 additions and 0 deletions

3
cli.js
View File

@ -74,6 +74,9 @@ const cli = meow(`
webpack: {
type: 'string',
},
debug: {
type: 'boolean'
}
}
})

View File

@ -172,6 +172,10 @@ module.exports = async (opts) => {
const config = merge(baseConfig, opts.webpack)
config.mode = opts.debug ? 'development' : 'production'
if (opts.debug) {
config.stats = 'verbose'
}
config.entry = path.join(__dirname, './entry')
config.output = {
path: opts.outDir,

View File

@ -50,6 +50,11 @@ module.exports = async (opts) => {
})
)
if (opts.debug) {
config.stats = 'verbose'
// todo: enable other logging
}
const serveOpts = {
config,
dev,