A plugin that generates a json file with the current timestamp and more.
npm install --save-dev version-file-generator-webpack-plugin
// Add to your Webpack config file
var VersionFileGeneratorWebpackPlugin = require('version-file-generator-webpack-plugin');
plugins: [new VersionFileGeneratorWebpackPlugin({
outputFile: path.join(__dirname, '/version.json'),
locale: 'en-US'
})]
// will output this:
{"date":"4/13/2018 15:03:48"}
var VersionFileGeneratorWebpackPlugin = require('version-file-generator-webpack-plugin');
plugins: [new VersionFileGeneratorWebpackPlugin({
outputFile: path.join(__dirname, '/version.json'),
locale: 'pt-BR',
content: JSON.stringify(/* your custom object goes here */)
})]
// will output the result of:
JSON.stringify(/* your custom object */)
var VersionFileGeneratorWebpackPlugin = require('version-file-generator-webpack-plugin');
{
outputFile: '/path/to/your/file.json',
locale: /* locale, defaults to 'en-US' */,
content: {}
}