This is the dev-server block providing webpack dev server configuration.
const { createConfig, env } = require('@webpack-blocks/webpack')
const devServer = require('@webpack-blocks/dev-server')
module.exports = createConfig([
// use only if `NODE_ENV === 'development'`:
env('development', [
devServer(),
// if you need to proxy API requests:
devServer.proxy({
'/api': { target: 'http://localhost:3000' }
}),
// in case you are using react-hot-loader 2.x:
// (need to install `react-hot-loader` package manually, though)
devServer.reactHot()
])
])Make sure you use this dev-server block after your entryPoint() blocks. The dev server will extend all of them with the 'webpack/hot/only-dev-server' entry point by default.
If you sense that this might be a major problem for you, feel free to engage in the pre/post-processing discussion.
Check out the
Released under the terms of the MIT license.