Webpack plugin to add or remove UTF-8 BOM (Byte Order Mark) from output files. Current stable version is 1.4.0, supporting both webpack 4 and 5. Lightweight plugin with a single configuration option (boolean). Differentiator: focused solely on BOM manipulation; alternatives may require custom loaders or post-processing.
npm install webpack-utf8-bomVerified import paths — ran on the pinned version, not inferred.
Webpack configuration that adds UTF-8 BOM to bundled output using BomPlugin.
Use at least v1.3.0 for webpack 5 compatibility.
Pass a boolean value: new BomPlugin(true) or new BomPlugin(false).
If you need source maps with BOM, ensure source maps are generated and the BOM plugin runs after.
Run npm install webpack-utf8-bom --save-dev
Use const BomPlugin = require('webpack-utf8-bom');Add new: new BomPlugin(true)