fis3-parser-replacer

1.0.1 • Public • Published

fis3-parser-replacer NPM Version

A parser for fis3 to replace string content

How to use

Install

npm install fis3-parser-replacer --save-dev

Add configure to fis-conf.js

// using single replace rule
fis.match('src/**.js', {
    parser: fis.plugin('replacer', {
        from: /xxx/g, // or string
        to: 'xxx'
    })
});

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

Options

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

  • to - string: the content to replace from

  • rules - Array.<Object>: using multiple replace rules, the rule item properties

    • from: the same as to option

    • to: the same as from option

  • 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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i fis3-parser-replacer

      Weekly Downloads

      1

      Version

      1.0.1

      License

      ISC

      Unpacked Size

      3.74 kB

      Total Files

      6

      Last publish

      Collaborators

      • angular-moon