Skip to content

Commit bab33a8

Browse files
authored
perf: remove node:assert import (#5309)
1 parent 99c5a22 commit bab33a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/core/src/plugins/splitChunks.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import assert from 'node:assert';
21
import { NODE_MODULES_REGEX } from '../constants';
32
import type {
43
ChunkSplit,
54
ForceSplitting,
65
Polyfill,
76
RsbuildPlugin,
87
Rspack,
8+
SplitBySize,
99
SplitChunks,
1010
} from '../types';
1111

@@ -150,8 +150,8 @@ function splitByModule(ctx: SplitChunksContext): SplitChunks {
150150
}
151151

152152
function splitBySize(ctx: SplitChunksContext): SplitChunks {
153-
const { override, forceSplittingGroups, defaultConfig, userConfig } = ctx;
154-
assert(userConfig.strategy === 'split-by-size');
153+
const { override, forceSplittingGroups, defaultConfig, userConfig } =
154+
ctx as SplitChunksContext & { userConfig: SplitBySize };
155155

156156
return {
157157
...defaultConfig,

0 commit comments

Comments
 (0)