webpack-encode-plugin

0.0.2 • Public • Published

Webpack Encode Plugin

A useful plugin to encode your file to another encoding from the one of your source code.

Usage

  1. Install
npm install -save-dev webpack-encode-plugin
  1. Example
var EncodePlugin = require('webpack-encode-plugin')

module.exports = {
    ...
    plugins: [
        ...
        new EncodePlugin({
            encoding: 'gbk'
        })
    ]
}

if you want to encode your file to UTF-* with BOM, you can setting like below:

var EncodePlugin = require('webpack-encode-plugin')

module.exports = {
    ...
    plugins: [
        ...
        new EncodePlugin({
            encoding: 'utf-8',
            config: {
                addBOM: true
            }
        })
    ]
}
  1. Others

The encoding module is iconv-lite, here is supported Content-type list.

Readme

Keywords

Package Sidebar

Install

npm i webpack-encode-plugin

Weekly Downloads

44

Version

0.0.2

License

MIT

Last publish

Collaborators

  • lanrendev