rollup-plugin-encoding

0.1.2 • Public • Published

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-encoding

Usage

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 encoded
  • dest:<string>* - path where to put encoded file
  • toCharset:<string>* - the charset to convert to
  • fromCharset:<string> - (optional, default 'UTF-8') the source charset
  • verbose:<boolean> - (optional, default false) display verbose message

Package Sidebar

Install

npm i rollup-plugin-encoding

Weekly Downloads

3

Version

0.1.2

License

MIT

Last publish

Collaborators

  • sly1986