forked from boranton/testcafe-workshop
debug webpack 🐛
This commit is contained in:
parent
3d528d280a
commit
985e1562ef
@ -28,6 +28,9 @@
|
|||||||
"build:dev": "webpack --env.dev",
|
"build:dev": "webpack --env.dev",
|
||||||
"start": "http-server",
|
"start": "http-server",
|
||||||
"dev": "webpack-dev-server --env.dev",
|
"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",
|
"validate": "npm-run-all --parallel lint build",
|
||||||
"lint": "eslint ."
|
"lint": "eslint ."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
|
/* eslint no-console:"off" */
|
||||||
const {resolve} = require('path')
|
const {resolve} = require('path')
|
||||||
const webpackValidator = require('webpack-validator')
|
const webpackValidator = require('webpack-validator')
|
||||||
const {getIfUtils} = require('webpack-config-utils')
|
const {getIfUtils} = require('webpack-config-utils')
|
||||||
|
|
||||||
module.exports = env => {
|
module.exports = env => {
|
||||||
const {ifProd} = getIfUtils(env)
|
const {ifProd} = getIfUtils(env)
|
||||||
return webpackValidator({
|
const config = webpackValidator({
|
||||||
context: resolve('src'),
|
context: resolve('src'),
|
||||||
entry: './bootstrap.js',
|
entry: './bootstrap.js',
|
||||||
output: {
|
output: {
|
||||||
@ -14,4 +15,9 @@ module.exports = env => {
|
|||||||
},
|
},
|
||||||
devtool: ifProd('source-map', 'eval'),
|
devtool: ifProd('source-map', 'eval'),
|
||||||
})
|
})
|
||||||
|
if (env.debug) {
|
||||||
|
console.log(config)
|
||||||
|
debugger // eslint-disable-line
|
||||||
|
}
|
||||||
|
return config
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user