write-file-webpack-plugin
Forces webpack-dev-server
program to write bundle files to the file system.
This plugin has no effect when webpack
program
is used instead of webpack-dev-server
.
Install
npm install write-file-webpack-plugin --save-dev
API
new WriteFilePlugin();
new WriteFilePlugin({
test: /\.css$/,
useHashIndex: true
});
Usage
Configure webpack.config.js
to use the write-file-webpack-plugin
plugin.
import path from 'path';
import WriteFilePlugin from 'write-file-webpack-plugin';
export default {
output: {
path: path.join(__dirname, './dist')
},
plugins: [
new WriteFilePlugin()
],
}
See ./sandbox for a working webpack
configuration.