Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@
"core-js",
"nx",
"simple-git-hooks"
]
],
"packageExtensions": {
"@vue/test-utils": {
"peerDependencies": {
"vue": "^3.5.17",
"@vue/compiler-dom": "3.5.17",
"@vue/server-renderer": "3.5.17"
}
}
}
}
}
5 changes: 4 additions & 1 deletion packages/core/src/core/rsbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ export const prepareRsbuild = async (
target: 'node',
},
tools: {
rspack: (config) => {
rspack: (config, { isProd }) => {
// treat `test` as development mode
config.mode = isProd ? 'production' : 'development';
config.output ??= {};
config.output.iife = false;
// polyfill interop
Expand Down Expand Up @@ -231,6 +233,7 @@ export const prepareRsbuild = async (
config.optimization = {
moduleIds: 'named',
chunkIds: 'named',
nodeEnv: false,
...(config.optimization || {}),
// make sure setup file and test file share the runtime
runtimeChunk: {
Expand Down
6 changes: 4 additions & 2 deletions packages/core/tests/core/__snapshots__/rsbuild.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (jsdom) 1`] =
"infrastructureLogging": {
"level": "error",
},
"mode": "none",
"mode": "development",
"module": {
"parser": {
"javascript": {
Expand Down Expand Up @@ -376,6 +376,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (jsdom) 1`] =
"emitOnErrors": true,
"minimize": false,
"moduleIds": "named",
"nodeEnv": false,
"runtimeChunk": {
"name": "runtime",
},
Expand Down Expand Up @@ -507,7 +508,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (node) 1`] = `
"infrastructureLogging": {
"level": "error",
},
"mode": "none",
"mode": "development",
"module": {
"parser": {
"javascript": {
Expand Down Expand Up @@ -844,6 +845,7 @@ exports[`prepareRsbuild > should generate rspack config correctly (node) 1`] = `
"emitOnErrors": true,
"minimize": false,
"moduleIds": "named",
"nodeEnv": false,
"runtimeChunk": {
"name": "runtime",
},
Expand Down
Loading
Loading