0.1.2 • Published 8 years ago
rollup-plugin-encoding v0.1.2
rollup-plugin-encoding
Rollup plugin to convert files from one encoding to another, built on top of encoding package.
Installation
npm install --save-dev rollup-plugin-encodingUsage
Add the following lines to your rollup.config.js:
import encoding from 'rollup-plugin-encoding';
export default {
// ...
plugins: [
encoding({
src: 'src/fileToEncode.js',
dest: 'dist/encodedFile.cp1251.js',
toCharset: 'CP1251',
verbose: true
})
]
}or
import encoding from 'rollup-plugin-encoding';
export default {
// ...
plugins: [
encoding([
{src: 'src/fileToEncode1.js', dest: 'dist/encodedFile1.js', toCharset: 'CP1251'},
{src: 'src/fileToEncode2.js', dest: 'dist/encodedFile2.js', toCharset: 'CP1251'},
// ...
])
]
}Options
src:<string>* - path to the file to be encodeddest:<string>* - path where to put encoded filetoCharset:<string>* - the charset to convert tofromCharset:<string>- (optional, default'UTF-8') the source charsetverbose:<boolean>- (optional, defaultfalse) display verbose message