Skip to content

Commit 7c93312

Browse files
authored
Alternate bundler: use built-in minifiers (#77056)
Unlike other built-in plugins, we’re going to use the native minifiers. This was trying to use these exports from `webpack`, where they don’t exist. This updates them to be imported from `@rspack/core` instead. Test Plan: Build the Rspack example (next PR in this stack)
1 parent dfa1be1 commit 7c93312

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

packages/next/src/build/webpack-config.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ import {
9393
NEXT_PROJECT_ROOT,
9494
NEXT_PROJECT_ROOT_DIST_CLIENT,
9595
} from './next-dir-paths'
96-
import { getRspackReactRefresh } from '../shared/lib/get-rspack'
96+
import { getRspackCore, getRspackReactRefresh } from '../shared/lib/get-rspack'
9797
import { RspackProfilingPlugin } from './webpack/plugins/rspack-profiling-plugin'
9898

9999
type ExcludesFalse = <T>(x: T | false) => x is T
@@ -1173,12 +1173,10 @@ export default async function getBaseWebpackConfig(
11731173
(isNodeServer && config.experimental.serverMinification)),
11741174
minimizer: isRspack
11751175
? [
1176-
// @ts-expect-error
1177-
new webpack.SwcJsMinimizerRspackPlugin({
1176+
new (getRspackCore().SwcJsMinimizerRspackPlugin)({
11781177
// JS minimizer configuration
11791178
}),
1180-
// @ts-expect-error
1181-
new webpack.LightningCssMinimizerRspackPlugin({
1179+
new (getRspackCore().LightningCssMinimizerRspackPlugin)({
11821180
// CSS minimizer configuration
11831181
}),
11841182
]

0 commit comments

Comments
 (0)