element-plus/build/gulp-rewriter.ts

17 lines
345 B
TypeScript
Raw Normal View History

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