Skip to content

Commit 4e99d0b

Browse files
authored
build!: simplify build & support esm import (element-plus#4018)
* build!: simplify build & support native esm import * build: refactor build * refactor: reorganize files * refactor: refactor build * build: improve perf * fix: scripts * build: add rollup-plugin-filesize * chore: scripts ignore no-console * build: disable tree-shaking * build: improve code * build: add sourcemap * build: add banner * refactor: remove annotation * build!: improve esm exports (element-plus#3871) * build: improve esm import * refactor: change mjs for esm version * chore: improve exports map * fix: add sideEffects * refactor: improve alias * build: upgrade dependencies
1 parent ef8a353 commit 4e99d0b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+560
-710
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ jobs:
2929
- name: Install dependencies
3030
run: pnpm i --frozen-lockfile
3131

32-
- name: Fetch Crowdin token for pulling languages
33-
run: pnpm docs:crowdin
32+
- name: Init Crowdin token
33+
run: pnpm run docs:crowdin-credentials
3434
env:
3535
CROWDIN_TOKEN: ${{secrets.CROWDIN_TOKEN}}
3636

.github/workflows/staging-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: pnpm build
3232

3333
- name: Init Crowdin token
34-
run: pnpm docs:crowdin
34+
run: pnpm run docs:crowdin-credentials
3535
env:
3636
CROWDIN_TOKEN: ${{secrets.CROWDIN_TOKEN}}
3737

build/info.ts renamed to build/build-info.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import path from 'path'
22
import { epOutput } from './utils/paths'
3+
import { EP_PKG } from './utils/constants'
34
import type { ModuleFormat } from 'rollup'
45

56
export const modules = ['esm', 'cjs'] as const
@@ -31,7 +32,7 @@ export const buildConfig: Record<Module, BuildInfo> = {
3132
path: path.resolve(epOutput, 'es'),
3233
},
3334
bundle: {
34-
path: 'element-plus/es',
35+
path: `${EP_PKG}/es`,
3536
},
3637
},
3738
cjs: {
@@ -43,9 +44,13 @@ export const buildConfig: Record<Module, BuildInfo> = {
4344
path: path.resolve(epOutput, 'lib'),
4445
},
4546
bundle: {
46-
path: 'element-plus/lib',
47+
path: `${EP_PKG}/lib`,
4748
},
4849
},
4950
}
51+
export const buildConfigEntries = Object.entries(
52+
buildConfig
53+
) as BuildConfigEntries
54+
5055
export type BuildConfig = typeof buildConfig
5156
export type BuildConfigEntries = [Module, BuildInfo][]

build/component.ts

Lines changed: 0 additions & 122 deletions
This file was deleted.

build/entry-types.ts

Lines changed: 0 additions & 82 deletions
This file was deleted.

0 commit comments

Comments
 (0)