0.1.0 • Published 7 years ago

emit-json-file-webpack-plugin v0.1.0

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

npm

Install

npm i -D emit-json-file-webpack-plugin

Usage

new EmitJsonFileWebpackPlugin([files])

A file looks like: { path: 'filePath', content: 'object' }

NameDetails
pathThis file path will created inside the Output Directory example: 'folder/file.txt'
contentThe JavaScript object to be formatted as JSON. The Plugin uses json-format internally to format the object.

Examples

const EmitJsonFileWebpackPlugin = require('emit-json-file-webpack-plugin')

const fileContent = {
    importantValueA: 'A',
    valueB: 'B'
}

module.exports = {
    ...
    plugins: [
        new EmitJsonFileWebpackPlugin([
            // {output}/folder/file.txt
            { path: 'folder/file.txt', content: fileContent },
        ])
    ]
}