A preprocessor for fis3 to replace string content
npm install fis3-preprocessor-replacer --save-devfis.match('src/**.js', {
preprocessor: fis.plugin('replacer', {
from: /xxx/g, // or string
to: 'xxx'
})
});fis.match('src/**.js', {
preprocessor: fis.plugin('replacer', {
rules: [{
from: /xxx/g, // or string
to: 'xxx'
}, {
from: /yyy/g, // or string
to: 'yyy'
}]
})
});-
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 theprocess.env.NODE_ENVwith the constant plain string, the string value is determined by the `isProd' option -
isProd -
isProd: whether in production environment