Skip to content

Latest commit

 

History

History
40 lines (30 loc) · 681 Bytes

File metadata and controls

40 lines (30 loc) · 681 Bytes

add-assets-webpack-plugin

Add arbitrary assets to a Webpack build

Install

npm install --save-dev add-assets-webpack-plugin

or

yarn add -D add-assets-webpack-plugin

Usage

new AddAssetsWebpackPlugin({
  filePath: "static/file.txt",
  content: 'Contents of the file'
})

Options

filePath: The file name (and path), relative to the webpack output directory

contents: The desired contents of the file

Multiple files

The constructor can take an object, or an array of objects:

new AddAssetsWebpackPlugin([
  {
    filePath: ".env",
    content: process.env.NODE_ENV
  },
  {
    filePath: "other.txt",
    content: 'eyy lmao'
  }
])