Skip to content

Commit 989d563

Browse files
committed
fix: update and detect module type
1 parent 61146d2 commit 989d563

File tree

15 files changed

+369
-35
lines changed

15 files changed

+369
-35
lines changed

examples/module-federation/mf-host/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"@module-federation/rsbuild-plugin": "^0.20.0",
1616
"@rsbuild/core": "1.6.0-beta.0",
1717
"@rsbuild/plugin-react": "^1.4.1",
18-
"@types/react": "^19.2.2",
19-
"@types/react-dom": "^19.2.1",
18+
"@types/react": "^19.2.0",
19+
"@types/react-dom": "^19.2.0",
2020
"typescript": "^5.9.3"
2121
}
2222
}

examples/module-federation/mf-remote/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"@module-federation/rsbuild-plugin": "^0.20.0",
1616
"@rsbuild/core": "1.6.0-beta.0",
1717
"@rsbuild/plugin-react": "^1.4.1",
18-
"@types/react": "^19.2.2",
19-
"@types/react-dom": "^19.2.1",
18+
"@types/react": "^19.2.0",
19+
"@types/react-dom": "^19.2.0",
2020
"typescript": "^5.9.3"
2121
}
2222
}

packages/core/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rslib/core",
3-
"version": "0.15.1",
3+
"version": "0.15.0",
44
"description": "The Rsbuild-based library development tool.",
55
"homepage": "https://rslib.rs",
66
"bugs": {
@@ -47,13 +47,13 @@
4747
"rsbuild-plugin-dts": "workspace:*"
4848
},
4949
"devDependencies": {
50-
"@module-federation/rsbuild-plugin": "^0.20.0",
50+
"@module-federation/rsbuild-plugin": "^0.19.1",
5151
"@rslib/tsconfig": "workspace:*",
5252
"@types/fs-extra": "^11.0.4",
5353
"cac": "^6.7.14",
5454
"chokidar": "^4.0.3",
5555
"fs-extra": "^11.3.2",
56-
"memfs": "^4.49.0",
56+
"memfs": "^4.48.1",
5757
"path-serializer": "0.5.1",
5858
"picocolors": "1.1.1",
5959
"prebundle": "1.4.2",

packages/core/src/config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ const composeFormatConfig = ({
629629
const plugins = [
630630
new rspack.experiments.RslibPlugin({
631631
interceptApiPlugin: true,
632+
forceNodeShims: true
632633
}),
633634
experimentalEsmOutput && new rspack.experiments.EsmLibraryPlugin(),
634635
].filter(Boolean);
@@ -1713,10 +1714,24 @@ const composeEsmDetectionConfig = (): EnvironmentConfig => {
17131714
test: /\.mts$/,
17141715
...esm,
17151716
},
1717+
{
1718+
test: /\.ts$/,
1719+
descriptionData: {
1720+
type: "module"
1721+
},
1722+
...esm,
1723+
},
17161724
{
17171725
test: /\.cts$/,
17181726
...cjs,
17191727
},
1728+
{
1729+
test: /\.ts$/,
1730+
descriptionData: {
1731+
type: "commonjs"
1732+
},
1733+
...cjs
1734+
}
17201735
],
17211736
},
17221737
},

0 commit comments

Comments
 (0)