Emits a JSON file that contains data passed through to it
npm install --save-dev write-json-webpack-plugin
// Add to your Webpack config file
var WriteJsonPlugin = require('write-json-webpack-plugin');
module.exports = {
plugins: [new WriteJsonPlugin()]
};
Write JSON Webpack Plugin accepts three options, the object to write, the path and filename
new WriteJsonPlugin({
object: [object]
path: 'public',
// default output is timestamp.json
filename: 'timestamp.json',
pretty: true // makes file human-readable (default false)
})