mirror of
https://github.com/element-plus/element-plus.git
synced 2025-01-24 11:05:17 +08:00
16f069ebbe
* Revert "build!: simplify build & support native esm import (#3900)"
This reverts commit fb94222bb4
.
* remove module
* Fix linter
* Add @element-plus/icons as dependency
* update pnpm lock file
* temporary lock element-plus at 1.1.0-beta.20
18 lines
544 B
TypeScript
18 lines
544 B
TypeScript
import through2 from 'through2'
|
|
import { pathRewriter } from './pkg'
|
|
import type { TaskFunction } from 'gulp'
|
|
import type { Module } from '../info'
|
|
|
|
export const withTaskName = <T extends TaskFunction>(name: string, fn: T) =>
|
|
Object.assign(fn, { displayName: name })
|
|
|
|
export const gulpPathRewriter = (module: Module) => {
|
|
const rewriter = pathRewriter(module, true)
|
|
|
|
return through2.obj((file, _, cb) => {
|
|
const contents: string = file.contents.toString()
|
|
file.contents = Buffer.from(rewriter(contents))
|
|
cb(null, file)
|
|
})
|
|
}
|