Skip to content

Commit 14df359

Browse files
authored
feat: support node polyfill (#318)
1 parent 0205864 commit 14df359

File tree

21 files changed

+956
-20
lines changed

21 files changed

+956
-20
lines changed

biome.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@
2121
"ignoreUnknown": true
2222
},
2323
"formatter": {
24-
"ignore": ["**/.rslib/*"],
24+
"ignore": [
25+
"**/.rslib/*",
26+
"./tests/e2e/react-component/public/umd/index.js"
27+
],
2528
"indentStyle": "space"
2629
},
2730
"javascript": {
@@ -42,7 +45,10 @@
4245
},
4346
"linter": {
4447
"enabled": true,
45-
"ignore": ["./tests/integration/**/*/src/*"],
48+
"ignore": [
49+
"./tests/integration/**/*/src/*",
50+
"./tests/e2e/react-component/public/umd/index.js"
51+
],
4652
"rules": {
4753
"recommended": true,
4854
"style": {

packages/core/src/config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,19 @@ export async function createConstantRsbuildConfig(): Promise<RsbuildConfig> {
417417
dev: {
418418
progressBar: false,
419419
},
420+
performance: {
421+
chunkSplit: {
422+
strategy: 'custom',
423+
},
424+
},
420425
tools: {
421426
htmlPlugin: false,
422427
rspack: {
423428
optimization: {
429+
splitChunks: {
430+
// Splitted "sync" chunks will make entry modules can't be inlined.
431+
chunks: 'async',
432+
},
424433
moduleIds: 'named',
425434
nodeEnv: false,
426435
},

packages/core/tests/__snapshots__/config.test.ts.snap

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
4848
"not dead",
4949
],
5050
},
51+
"performance": {
52+
"chunkSplit": {
53+
"strategy": "custom",
54+
},
55+
},
5156
"plugins": [],
5257
"source": {
5358
"alias": {
@@ -71,6 +76,9 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
7176
"optimization": {
7277
"moduleIds": "named",
7378
"nodeEnv": false,
79+
"splitChunks": {
80+
"chunks": "async",
81+
},
7482
},
7583
"resolve": {
7684
"extensionAlias": {
@@ -199,6 +207,11 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
199207
"not dead",
200208
],
201209
},
210+
"performance": {
211+
"chunkSplit": {
212+
"strategy": "custom",
213+
},
214+
},
202215
"plugins": [
203216
{
204217
"name": "rsbuild:cjs-import-meta-url-shim",
@@ -231,6 +244,9 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
231244
"optimization": {
232245
"moduleIds": "named",
233246
"nodeEnv": false,
247+
"splitChunks": {
248+
"chunks": "async",
249+
},
234250
},
235251
"resolve": {
236252
"extensionAlias": {
@@ -348,6 +364,11 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
348364
"not dead",
349365
],
350366
},
367+
"performance": {
368+
"chunkSplit": {
369+
"strategy": "custom",
370+
},
371+
},
351372
"source": {
352373
"alias": {
353374
"bar": "bar",
@@ -370,6 +391,9 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config 1
370391
"optimization": {
371392
"moduleIds": "named",
372393
"nodeEnv": false,
394+
"splitChunks": {
395+
"chunks": "async",
396+
},
373397
},
374398
"resolve": {
375399
"extensionAlias": {

0 commit comments

Comments
 (0)