1.1.0 • Published 6 years ago

write-webpack-plugin v1.1.0

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

Write Webpack Plugin

Writes individual files to the build directory.

Installation

npm install --save-dev write-webpack-plugin

Usage

const WriteWebpackPlugin = require('write-webpack-plugin')

module.exports = {
  // ...
  plugins: [
    new WriteWebpackPlugin([
      { name: 'hello.txt', data: Buffer.from('Hello, World!') },
      { name: 'icon.svg', data: Buffer.from('<?xml ...') }
    ])
  ]
}

This will output two files: hello.txt, and icon.svg.

API

File Properties

NameTypeRequiredDetails
namestringYThe name of the file to be written.
dataBufferYThe content to be written into the file.