mirror of
https://github.com/element-plus/element-plus.git
synced 2025-02-05 11:21:11 +08:00
6447feb505
* Revert "fix(components): [el-date-picker] dayjs props not extended (#3662)"
This reverts commit fb8446709f
.
* fix(build): fix rollup externals
28 lines
875 B
TypeScript
28 lines
875 B
TypeScript
import { epPackage } from './paths'
|
|
import { getWorkspacePackages, getPackageDependencies } from './pkg'
|
|
|
|
import type { OutputOptions, RollupBuild } from 'rollup'
|
|
|
|
export const generateExternal = async (options: { full: boolean }) => {
|
|
const monoPackages = (await getWorkspacePackages())
|
|
.map((pkg) => pkg.manifest.name)
|
|
// filter root package
|
|
.filter((name): name is string => !!name)
|
|
|
|
return (id: string) => {
|
|
const packages: string[] = ['vue']
|
|
if (!options.full) {
|
|
const depPackages = getPackageDependencies(epPackage)
|
|
packages.push('@vue', ...monoPackages, ...depPackages)
|
|
}
|
|
|
|
return [...new Set(packages)].some(
|
|
(pkg) => id === pkg || id.startsWith(`${pkg}/`)
|
|
)
|
|
}
|
|
}
|
|
|
|
export function writeBundles(bundle: RollupBuild, options: OutputOptions[]) {
|
|
return Promise.all(options.map((option) => bundle.write(option)))
|
|
}
|