webpack-bundle-output
v1.1.0
Published
Webpack Plugin for creating map from source file to chunk
Readme
BundleOutputPlugin
BundleOutputPlugin is a webpack plugin for producing "inverse source-maps".
This plugin produces a map.json that maps each source file to all the build files it is included in (key source file to build file array).
It was created for this issue to implement translating source files for WordPress plugins+themes.
Installation
npm install --save-dev webpack-bundle-output
Usage
Simply include BundleOutputPlugin in the plugins array of your webpack.config.js:
const BundleOutputPlugin = require('webpack-bundle-output');
module.exports = {
...,
plugins: [new BundleOutputPlugin()],
...,
}Since version 1.1.0, this plugin also works properly in production mode.
Options
The plugin supports two options (new BundleOutputPlugin({ ... })):
cwd(string). The working directory, relative to which the map should be. Influences both source and build path. Default:process.cwd()output(string). The output name/path of the map file in the build directory. Default:map.json.
