diff --git a/package.json b/package.json index 3573787..ab47825 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,9 @@ "build:dev": "webpack --env.dev", "start": "http-server", "dev": "webpack-dev-server --env.dev", + "debug": "node-nightly --inspect --debug-brk node_modules/.bin/webpack --env.debug", + "debug:dev": "npm run debug -- --env.dev", + "debug:prod": "npm run debug -- --env.prod", "validate": "npm-run-all --parallel lint build", "lint": "eslint ." } diff --git a/webpack.config.babel.js b/webpack.config.babel.js index eea0e5d..3af2c98 100644 --- a/webpack.config.babel.js +++ b/webpack.config.babel.js @@ -1,10 +1,11 @@ +/* eslint no-console:"off" */ const {resolve} = require('path') const webpackValidator = require('webpack-validator') const {getIfUtils} = require('webpack-config-utils') module.exports = env => { const {ifProd} = getIfUtils(env) - return webpackValidator({ + const config = webpackValidator({ context: resolve('src'), entry: './bootstrap.js', output: { @@ -14,4 +15,9 @@ module.exports = env => { }, devtool: ifProd('source-map', 'eval'), }) + if (env.debug) { + console.log(config) + debugger // eslint-disable-line + } + return config }