fis3-preprocessor-replacer-multi

0.1.1 • Public • Published

fis3-preprocessor-replacer NPM Version

A preprocessor for fis3 to replace string content

How to use

Install

npm install fis3-preprocessor-replacer --save-dev

Add configure to fis-conf.js

fis.match('src/**.js', {
    preprocessor: fis.plugin('replacer', {
        from: /xxx/g, // or string
        to: 'xxx'
    })
});

Multi-replace

fis.match('src/**.js', {
    preprocessor: fis.plugin('replacer', {
        rules: [{
         from: /xxx/g, // or string
         to: 'xxx'
        }, {
         from: /yyy/g, // or string
         to: 'yyy'
        }]
    })
});

Options

  • from - string|RegExp: the regexp or string to replace

  • to - string: the content to replace from

  • rules - array: multi-replace rule

  • envify - boolean: whether to replace the process.env.NODE_ENV with the constant plain string, the string value is determined by the `isProd' option

  • isProd - isProd: whether in production environment

Relevant

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.1
    0

Package Sidebar

Install

npm i fis3-preprocessor-replacer-multi

Weekly Downloads

0

Version

0.1.1

License

ISC

Last publish

Collaborators

  • mudoo