download-json-webpack-plugin
v0.1.0
Published
Loads JSON from given URL and saves it locally.
Downloads
3
Readme
##How it works
Loads JSON from given URL and saves it locally.
##Usage
const DownloadJsonPlugin = require('download-json-webpack-plugin');
module.exports = {
plugins: [
new DownloadJsonPlugin({
path: '<JSON URL>',
filename: 'local.json',
onBeforeSave: (json) => parseJson
})
]
}
##Options
- path remote URL of the JSON to download
- filename filename where loaded JSON will be saved
- onBeforeSave optional function that can modify loaded data. It should return object that will be saved.