mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-09 02:31:33 +08:00
17 lines
345 B
TypeScript
17 lines
345 B
TypeScript
|
import through2 from 'through2'
|
||
|
|
||
|
const rewriter = (rewriteTo = '../..') => {
|
||
|
return through2.obj(function(file, _, cb) {
|
||
|
const compIdentifier = '@element-plus'
|
||
|
|
||
|
file.contents = Buffer.from(
|
||
|
file.contents
|
||
|
.toString()
|
||
|
.replaceAll(compIdentifier, rewriteTo),
|
||
|
)
|
||
|
cb(null, file)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
export default rewriter
|