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
52 lines
1.0 KiB
TypeScript
52 lines
1.0 KiB
TypeScript
import path from 'path'
|
|
import { epOutput } from './utils/paths'
|
|
import type { ModuleFormat } from 'rollup'
|
|
|
|
export const modules = ['esm', 'cjs'] as const
|
|
export type Module = typeof modules[number]
|
|
export interface BuildInfo {
|
|
module: 'ESNext' | 'CommonJS'
|
|
format: ModuleFormat
|
|
ext: 'mjs' | 'cjs' | 'js'
|
|
output: {
|
|
/** e.g: `es` */
|
|
name: string
|
|
/** e.g: `dist/element-plus/es` */
|
|
path: string
|
|
}
|
|
|
|
bundle: {
|
|
/** e.g: `element-plus/es` */
|
|
path: string
|
|
}
|
|
}
|
|
|
|
export const buildConfig: Record<Module, BuildInfo> = {
|
|
esm: {
|
|
module: 'ESNext',
|
|
format: 'esm',
|
|
ext: 'mjs',
|
|
output: {
|
|
name: 'es',
|
|
path: path.resolve(epOutput, 'es'),
|
|
},
|
|
bundle: {
|
|
path: 'element-plus/es',
|
|
},
|
|
},
|
|
cjs: {
|
|
module: 'CommonJS',
|
|
format: 'cjs',
|
|
ext: 'js',
|
|
output: {
|
|
name: 'lib',
|
|
path: path.resolve(epOutput, 'lib'),
|
|
},
|
|
bundle: {
|
|
path: 'element-plus/lib',
|
|
},
|
|
},
|
|
}
|
|
export type BuildConfig = typeof buildConfig
|
|
export type BuildConfigEntries = [Module, BuildInfo][]
|