webpack-code-replace-loader
v0.0.2
Published
根据配置文件/build/code-replace.js替换
Downloads
4
Readme
🚀 webpack-code-replace-loader
根据配置文件/build/code-replace.js替换,格式如:
module.exports = {
replaceList: [
{
source: '需替换的文本',
target: '替换目标文本'
},
{
source: /需要替换的文本正则表达式/,
target: '替换目标文本'
}
]
}
install
npm i webpack-code-replace-loader -D
use
const codeReplace = require('./build/code-replace.js')
config.module
.rule('webpack-code-replace')
.test(/\.(vue|js|ts)$/)
.use('webpack-code-replace-loader')
.loader('webpack-code-replace-loader')
.options({
...codeReplace
})
.end()
LICENSE
MIT