Webpack Encode Plugin
A useful plugin to encode your file to another encoding from the one of your source code.Usage
- Install
npm install -save-dev webpack-encode-plugin
- 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
}
})
]
}
- Others
The encoding module is iconv-lite, here is supported Content-type list.