Skip to content

Commit 410c050

Browse files
committed
feat: advanced esm
1 parent a54d243 commit 410c050

File tree

20 files changed

+871
-13
lines changed

20 files changed

+871
-13
lines changed

.github/workflows/preview.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ name: Preview Release
33

44
on:
55
push:
6-
branches: [main]
6+
branches:
7+
- main
8+
- beta
79
workflow_dispatch:
810

911
permissions:

.github/workflows/reusable-test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ jobs:
9292
if: ${{ steps.changes.outputs.changed == 'true' && inputs.task == 'integration' }}
9393
run: pnpm run test:integration
9494

95+
- name: Integration Test with Advanced ESM (Rstest)
96+
if: ${{ steps.changes.outputs.changed == 'true' && inputs.task == 'integration-advanced-esm' }}
97+
run: pnpm run test:integration:advanced-esm
98+
9599
- name: E2E Test (Playwright)
96100
if: ${{ steps.changes.outputs.changed == 'true' && inputs.task == 'e2e' }}
97101
run: pnpm run test:e2e

.github/workflows/test.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ jobs:
3939
node-version: ${{ matrix.node-version }}
4040
task: integration
4141

42+
integration-advanced-esm:
43+
strategy:
44+
matrix:
45+
runner: [ubuntu-latest, windows-latest]
46+
node-version: [22]
47+
uses: ./.github/workflows/reusable-test.yml
48+
with:
49+
runner: ${{ matrix.runner }}
50+
node-version: ${{ matrix.node-version }}
51+
task: integration-advanced-esm
52+
4253
e2e:
4354
strategy:
4455
matrix:

examples/express-plugin/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export default defineConfig({
88
output: {
99
distPath: './dist/esm',
1010
},
11+
experiments: {
12+
advancedEsm: true,
13+
},
1114
},
1215
{
1316
format: 'cjs',

examples/module-federation/mf-react-component/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export default defineConfig({
1010
output: {
1111
distPath: './dist/esm',
1212
},
13+
experiments: {
14+
advancedEsm: true,
15+
},
1316
},
1417
{
1518
format: 'cjs',

examples/react-component-bundle/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export default defineConfig({
1010
output: {
1111
distPath: './dist/esm',
1212
},
13+
experiments: {
14+
advancedEsm: true,
15+
},
1316
},
1417
{
1518
format: 'cjs',

examples/solid-component-bundle/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export default defineConfig({
88
{
99
format: 'esm',
1010
dts: true,
11+
experiments: {
12+
advancedEsm: true,
13+
},
1114
},
1215
],
1316
output: {

examples/vue-component-bundle/rslib.config.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ import { pluginUnpluginVue } from 'rsbuild-plugin-unplugin-vue';
33

44
export default defineConfig({
55
plugins: [pluginUnpluginVue()],
6-
lib: [{ format: 'esm' }],
6+
lib: [
7+
{
8+
format: 'esm',
9+
experiments: {
10+
advancedEsm: true,
11+
},
12+
},
13+
],
714
output: {
815
target: 'web',
916
},

examples/vue-component-bundleless/rslib.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@ import { pluginUnpluginVue } from 'rsbuild-plugin-unplugin-vue';
33

44
export default defineConfig({
55
plugins: [pluginUnpluginVue()],
6-
lib: [{ bundle: false, format: 'esm' }],
6+
lib: [
7+
{
8+
format: 'esm',
9+
bundle: false,
10+
},
11+
],
712
output: {
813
target: 'web',
914
},

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@
1515
"prebundle": "nx run-many -t prebundle",
1616
"prepare": "pnpm run build && simple-git-hooks",
1717
"sort-package-json": "npx sort-package-json \"packages/*/package.json\"",
18-
"test": "pnpm run test:unit && pnpm run test:integration && pnpm run test:e2e",
18+
"test": "pnpm run test:unit && pnpm run test:integration && pnpm run test:integration:advanced-esm && pnpm run test:e2e",
1919
"test:benchmark": "cd ./tests && pnpm run test:benchmark",
2020
"test:e2e": "pnpm run build:examples && cd tests && pnpm run test:e2e",
21-
"test:ecosystem-ci": "pnpm run test:unit && cross-env ECO_CI=1 pnpm run test:integration && pnpm run test:e2e",
21+
"test:ecosystem-ci": "pnpm run test:unit && cross-env ECO_CI=1 pnpm run test:integration && cross-env ECO_CI=1 pnpm run test:integration:advanced-esm && pnpm run test:e2e",
2222
"test:integration": "rstest run --project integration",
23+
"test:integration:advanced-esm": "cross-env ADVANCED_ESM=1 rstest run --project integration",
2324
"test:unit": "rstest run --project unit*",
24-
"testu": "pnpm run test:unit -u && pnpm run test:integration -u",
25+
"testu": "pnpm run test:unit -u && pnpm run test:integration -u && pnpm test:integration:advanced-esm -u",
2526
"type-check": "pnpm -r run type-check",
2627
"update:rsbuild": "npx taze minor --include /rsbuild/ -w -r -l",
2728
"watch": "pnpm build --watch"

0 commit comments

Comments
 (0)