0.0.2 • Published 7 years ago

webpack-encode-plugin v0.0.2

Weekly downloads
89
License
MIT
Repository
github
Last release
7 years ago

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.

0.0.2

7 years ago

0.0.1

7 years ago