mirror of
https://github.com/element-plus/element-plus.git
synced 2024-12-27 03:01:14 +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
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import path from 'path'
|
|
import { parallel, dest, src } from 'gulp'
|
|
import ts from 'gulp-typescript'
|
|
import { buildOutput, compRoot } from './utils/paths'
|
|
import { buildConfig } from './info'
|
|
import { withTaskName, gulpPathRewriter } from './utils/gulp'
|
|
import { run } from './utils/process'
|
|
|
|
import type { Module } from './info'
|
|
|
|
const inputs = path.resolve(compRoot, '**/style/*.ts')
|
|
const output = path.resolve(buildOutput, 'styles')
|
|
|
|
const tsProject = (module: Module) =>
|
|
ts.createProject('tsconfig.json', {
|
|
declaration: true,
|
|
target: 'ESNext',
|
|
skipLibCheck: true,
|
|
module: buildConfig[module].module,
|
|
})()
|
|
|
|
const build = (module: Module) =>
|
|
withTaskName(`buildStyle:${module}`, () =>
|
|
src(inputs)
|
|
.pipe(gulpPathRewriter(module))
|
|
.pipe(tsProject(module))
|
|
.pipe(dest(path.resolve(output, buildConfig[module].output.name)))
|
|
)
|
|
|
|
export const buildStyle = parallel(build('esm'), build('cjs'))
|
|
|
|
export const copyStyle = () => {
|
|
const copy = (module: Module) => {
|
|
const config = buildConfig[module]
|
|
const src = path.resolve(buildOutput, 'styles', config.output.name)
|
|
const dst = path.resolve(config.output.path, 'components')
|
|
|
|
return withTaskName(`copyStyle:${module}`, () =>
|
|
run(`rsync -a ${src}/ ${dst}/`)
|
|
)
|
|
}
|
|
|
|
return parallel(copy('esm'), copy('cjs'))
|
|
}
|