https://github.com/fengxq2014/fis3-postprocessor-replace
fis3 replace plugin
https://github.com/fengxq2014/fis3-postprocessor-replace
Last synced: 2 months ago
JSON representation
fis3 replace plugin
- Host: GitHub
- URL: https://github.com/fengxq2014/fis3-postprocessor-replace
- Owner: Fengxq2014
- License: mit
- Created: 2016-05-27T05:15:28.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-10-10T01:32:56.000Z (over 8 years ago)
- Last Synced: 2025-01-25T10:26:57.096Z (4 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://nodei.co/npm/fis3-postprocessor-replace/)
### 本插件将会根据配置替换字符串,适用于打包规则```
npm install fis3-postprocessor-replace -g
```
fis-conf
```
fis.match('*.js', {
postprocessor: fis.plugin('replace', {
files: [
{
path: "/js/controllers/login.js",
rule:{
'{api-url}|i': '/json/login.json',
'{api-u}':'GET'
}
},
{
path:"/js/controllers/lists.js",
rule:{
'{api-url}|ig':'192.168.10.0',
'{api-u}':'345'
}
}
]
})
})
```
这样配置的话,将在编译阶段根据正则替换`/js/controllers/login.js`和`/js/controllers/lists.js`对应的`{api-url}`和`{api-u}`。