element-plus/build/gulpfile.ts
jeremywu 16f069ebbe
Revert "build!: simplify build & support native esm import (#3900)" (#3945)
* 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
2021-10-20 09:42:32 +08:00

55 lines
1.4 KiB
TypeScript

import path from 'path'
import { series, parallel } from 'gulp'
import { copyStyle } from './style'
import { copyEntryTypes } from './entry-types'
import { run } from './utils/process'
import { withTaskName } from './utils/gulp'
import { epOutput, epPackage, projRoot } from './utils/paths'
import { copyFullStyle } from './full-bundle'
const runTask = (name: string) =>
withTaskName(name, () => run(`pnpm run build ${name}`))
export const copySourceCode = async () => {
await run(`cp -R packages ${epOutput}`)
await run(`cp ${epPackage} ${epOutput}/package.json`)
}
export const copyREADME = async () => {
await run(`cp README.md ${epOutput}`)
}
export const copyDefinitions = async () => {
const files = [path.resolve(projRoot, 'typings', 'global.d.ts')]
await run(`cp ${files.join(' ')} ${epOutput}`)
}
export default series(
withTaskName('clean', () => run('pnpm run clean')),
parallel(
runTask('buildComponent'),
runTask('buildStyle'),
runTask('buildFullBundle'),
runTask('buildHelper'),
withTaskName('buildEachPackages', () =>
run('pnpm run --filter ./packages --parallel --stream build')
)
),
parallel(
copyStyle(),
copyFullStyle,
copyEntryTypes,
copySourceCode,
copyREADME,
copyDefinitions
)
)
export * from './component'
export * from './style'
export * from './full-bundle'
export * from './entry-types'
export * from './helper'