0.1.1 • Published 8 years ago
fis3-preprocessor-replacer-multi v0.1.1
fis3-preprocessor-replacer 
A preprocessor for fis3 to replace string content
How to use
Install
npm install fis3-preprocessor-replacer --save-devAdd 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 replaceto -
string: the content to replace fromrules -
array: multi-replace ruleenvify -
boolean: whether to replace theprocess.env.NODE_ENVwith the constant plain string, the string value is determined by the `isProd' optionisProd -
isProd: whether in production environment
Relevant
0.1.1
8 years ago