I don't get it how it's supposed to work.
I'v added write-file-webpack-plugin to my webpack.config.js:
var WriteFilePlugin = require('write-file-webpack-plugin');
and included it in plugins:
plugins: [
new WriteFilePlugin({force: true}),
new webpack.HotModuleReplacementPlugin(),
],
Also, I've set devServer's outputPath to be the same as output.path as you recommended:
config.devServer = {
host: 'localhost',
//hot: true, // adding back will break webpack-dev-server!
//port: 8080,
port: 8080,
inline: true,
stats: '_errors-only',
contentBase: './',
outputPath: './app/dist/js/' // needed?
};
config.output = {
path: './app/dist/js/' // needed?
};
For the sake of test, I've deleted my previously generated bundle.js and run webpack-dev-server. Output:
C:\sites\YDR\branches\refactoring\development>webpack-dev-server
[11:27:38] [write-file-webpack-plugin] options { exitOnErrors: true,
force: true,
log: true,
test: null,
useHashIndex: true }
http://localhost:8080/
webpack result is served from /
content is served from ./
(... typical dev-server output ...)
But no bundle.js is created anywhere.
I don't get it how it's supposed to work.
I'v added write-file-webpack-plugin to my
webpack.config.js:var WriteFilePlugin = require('write-file-webpack-plugin');and included it in plugins:
Also, I've set devServer's outputPath to be the same as output.path as you recommended:
For the sake of test, I've deleted my previously generated bundle.js and run webpack-dev-server. Output:
But no bundle.js is created anywhere.