utf8-bom-webpack

ADD OR REMOVE BOM FOR WEBPACK

Usage no npm install needed!

<script type="module">
  import utf8BomWebpack from 'https://cdn.skypack.dev/utf8-bom-webpack';
</script>

README

utf8-bom-webpack

Original link : webpack-utf8-bom.

ADD OR REMOVE BOM FOR WEBPACK4

I use a Windows PC for work in company.

It creates file with BOM.

Howerver the files generated by Webpack do not contain the BOM.

So I write this plugin for Webpack so that it can add or remove BOM automatically when generates files, by default only files matching the /.(html|htm|css|js|map)$/ pattern are processed.

Usage

In webpack config file:

var webpack = require('webpack');

// import plugin
var BomPlugin = require('utf8-bom-webpack');

module.exports = {
  ...
  plugins: [
    // Add plugin in plugins list
    // true for adding bom
    // false for removing bom
    new BomPlugin(true)
  ],

 ...
};