0.0.1 • Published 6 years ago

version-file-generator-webpack-plugin v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

Version Generator Webpack Plugin

A plugin that generates a json file with the current timestamp and more.

Install

npm install --save-dev version-file-generator-webpack-plugin

Configuration

// 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"}

Custom output

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 */)

API

var VersionFileGeneratorWebpackPlugin = require('version-file-generator-webpack-plugin');

{
    outputFile: '/path/to/your/file.json',
    locale: /* locale, defaults to 'en-US' */,
    content: {}
}