diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index b93abcdad20..707e4da693f 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -62,6 +62,7 @@ module.exports = { // containing code from all our entry points, and the Webpack runtime. filename: 'static/js/bundle.js', // In development, we always serve from the root. This makes config easier. + contentBase: "./src", publicPath: '/' }, resolve: { diff --git a/scripts/start.js b/scripts/start.js index aa68ab40ff3..e07609df005 100644 --- a/scripts/start.js +++ b/scripts/start.js @@ -228,6 +228,9 @@ function runDevServer(port) { // It is important to tell WebpackDevServer to use the same "root" path // as we specified in the config. In development, we always serve from /. publicPath: config.output.publicPath, + //Can be used to configure the behaviour of webpack-dev-server + //when the webpack config is passed to webpack-dev-server CLI. + contentBase: config.output.contentBase, // WebpackDevServer is noisy by default so we emit custom message instead // by listening to the compiler events with `compiler.plugin` calls above. quiet: true,