diff --git a/packages/cli/src/lib/bundler/backend.ts b/packages/cli/src/lib/bundler/backend.ts index e089a9fd72..598b77bc51 100644 --- a/packages/cli/src/lib/bundler/backend.ts +++ b/packages/cli/src/lib/bundler/backend.ts @@ -20,24 +20,17 @@ import { resolveBundlingPaths } from './paths'; import { BackendServeOptions } from './types'; export async function serveBackend(options: BackendServeOptions) { - const useRspack = !!process.env.EXPERIMENTAL_RSPACK; - const paths = resolveBundlingPaths(options); const config = await createBackendConfig(paths, { ...options, isDev: true, - useRspack, }); // Webpack only replaces occurrences of this in code it touches, which does // not include dependencies in node_modules. So we set it here at runtime as well. (process.env as { NODE_ENV: string }).NODE_ENV = 'development'; - const bundler: typeof webpack = useRspack - ? require('@rspack/core').rspack - : webpack; - - const compiler = bundler(config, (err: Error | null) => { + const compiler = webpack(config, (err: Error | null) => { if (err) { console.error(err); } else console.log('Build succeeded'); diff --git a/packages/cli/src/lib/bundler/config.ts b/packages/cli/src/lib/bundler/config.ts index 59ef2655cc..958104a68f 100644 --- a/packages/cli/src/lib/bundler/config.ts +++ b/packages/cli/src/lib/bundler/config.ts @@ -447,7 +447,7 @@ export async function createBackendConfig( paths: BundlingPaths, options: BackendBundlingOptions, ): Promise { - const { checksEnabled, isDev, useRspack } = options; + const { checksEnabled, isDev } = options; // Find all local monorepo packages and their node_modules, and mark them as external. const { packages } = await getPackages(cliPaths.targetDir); @@ -518,16 +518,13 @@ export async function createBackendConfig( extensions: ['.ts', '.mjs', '.js', '.json'], mainFields: ['main'], modules: [paths.rootNodeModules, ...moduleDirs], - // FIXME: see also https://github.com/web-infra-dev/rspack/issues/3408 - ...(!useRspack && { - plugins: [ - new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs), - new ModuleScopePlugin( - [paths.targetSrc, paths.targetDev], - [paths.targetPackageJson], - ), - ], - }), + plugins: [ + new LinkedPackageResolvePlugin(paths.rootNodeModules, externalPkgs), + new ModuleScopePlugin( + [paths.targetSrc, paths.targetDev], + [paths.targetPackageJson], + ), + ], }, module: { rules: loaders, @@ -554,9 +551,7 @@ export async function createBackendConfig( nodeArgs: runScriptNodeArgs.length > 0 ? runScriptNodeArgs : undefined, args: process.argv.slice(3), // drop `node backstage-cli backend:dev` }), - new (useRspack - ? require('@rspack/core').rspack.HotModuleReplacementPlugin - : webpack.HotModuleReplacementPlugin)(), + new webpack.HotModuleReplacementPlugin(), ...(checksEnabled ? [ new ForkTsCheckerWebpackPlugin({