Force webpack-dev-server/webpack-dev-middleware program to write bundle files to the file system.
npm install write-assets-webpack-plugin[![npm][npm]][npm-url]
[![node][node]][node-url]
![npm][npm-download]
[![deps][deps]][deps-url]
[![tests][tests]][tests-url]
[npm]: https://img.shields.io/npm/v/write-assets-webpack-plugin.svg
[npm-url]: https://npmjs.com/package/write-assets-webpack-plugin
[npm-download]: https://img.shields.io/npm/dt/write-assets-webpack-plugin.svg
[node]: https://img.shields.io/node/v/write-assets-webpack-plugin.svg
[node-url]: https://nodejs.org
[deps]: https://david-dm.org/euclid1990/write-assets-webpack-plugin.svg
[deps-url]: https://david-dm.org/euclid1990/write-assets-webpack-plugin.svg
[tests]: http://img.shields.io/travis/euclid1990/write-assets-webpack-plugin.svg
[tests-url]: https://travis-ci.org/euclid1990/write-assets-webpack-plugin
Force webpack-dev-server/webpack-dev-middleware/webpack-hot-middleware program to write bundle files to the file system.
The webpack-dev-server (even when you use webpack-dev-middleware/webpack-hot-middleware) doesn't write files to disk.
Relate issue on webpack-dev-server repository | stackoverflow.
If you want to force webpack-dev-server to write to the file system, you can use this plugin.
``bash`
npm i --save-dev write-assets-webpack-plugin`bash`
yarn add --dev write-assets-webpack-plugin
`js`
const WriteAssetsWebpackPlugin = require('write-assets-webpack-plugin');
...
// Webpack configuration
module.exports = {
entry: 'index.js',
output: {
path: __dirname + '/dist',
filename: 'bundle.js'
},
...
plugins: [
new WriteAssetsWebpackPlugin({ force: true, extension: ['js'] })
]
}
See Example.
You're free to contribute to this project by submitting issues and/or pull requests.
* Fork the repository and make changes on your fork in a feature branch.
* Commit messages must start with a capitalized and short summary.
* After every commit, make sure the test suite passes.
`bash`
$ yarn run build:test
$ yarn run test`
* To ensure consistency throughout the source code, keep these coding styles.bash`
$ yarn run lint`
* Or run development mode with eslint and babel auto transpilerbash`
$ yarn run dev
* Before you submit your Pull Request (PR) consider the open or closed PR that relates to your submission.
You can testing this npm package before releasing it using yarn link | Verdaccio.
`bash``Create verdaccio container
$ docker-compose upRegister the first user for you
$ npm adduser --registry http://localhost:4873Publishing the package locally
$ npm publish --registry http://localhost:4873Install package from locally registry
$ npm install write-assets-webpack-plugin --registry http://localhost:4873