https://github.com/cpiber/webpack-bundle-output
A webpack plugin for producing "inverse source-maps".
https://github.com/cpiber/webpack-bundle-output
webpack webpack-plugin wordpress-development
Last synced: about 1 year ago
JSON representation
A webpack plugin for producing "inverse source-maps".
- Host: GitHub
- URL: https://github.com/cpiber/webpack-bundle-output
- Owner: cpiber
- Created: 2021-08-28T20:40:26.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-03-13T21:10:32.000Z (over 1 year ago)
- Last Synced: 2025-03-24T09:47:23.020Z (over 1 year ago)
- Topics: webpack, webpack-plugin, wordpress-development
- Language: JavaScript
- Homepage:
- Size: 133 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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](https://github.com/wp-cli/i18n-command/issues/282) 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`:
```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`.