add support for experimental rspack bundler for the cli repo build command
Signed-off-by: Adrian Soovary <adrian.soovary@otto.de>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
added experimental RSPack support for build command in the repo scope
|
||||
@@ -31,6 +31,11 @@ import { createScriptOptionsParser } from './optionsParser';
|
||||
|
||||
export async function command(opts: OptionValues, cmd: Command): Promise<void> {
|
||||
let packages = await PackageGraph.listTargetPackages();
|
||||
const shouldUseRspack = Boolean(process.env.EXPERIMENTAL_RSPACK);
|
||||
|
||||
const rspack = shouldUseRspack
|
||||
? (require('@rspack/core') as typeof import('@rspack/core').rspack)
|
||||
: undefined;
|
||||
|
||||
if (opts.since) {
|
||||
const graph = PackageGraph.fromPackages(packages);
|
||||
@@ -111,6 +116,7 @@ export async function command(opts: OptionValues, cmd: Command): Promise<void> {
|
||||
targetDir: pkg.dir,
|
||||
configPaths: (buildOptions.config as string[]) ?? [],
|
||||
writeStats: Boolean(buildOptions.stats),
|
||||
rspack,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
@@ -119,6 +119,12 @@ export async function buildBundle(options: BuildOptions) {
|
||||
);
|
||||
}
|
||||
|
||||
if (rspack) {
|
||||
console.log(
|
||||
chalk.yellow(`⚠️ WARNING: Using experimental RSPack bundler.`),
|
||||
);
|
||||
}
|
||||
|
||||
const { stats } = await build(configs, isCi, rspack);
|
||||
|
||||
if (!stats) {
|
||||
|
||||
@@ -233,6 +233,12 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be
|
||||
? require('@rspack/dev-server').RspackDevServer
|
||||
: WebpackDevServer;
|
||||
|
||||
if (rspack) {
|
||||
console.log(
|
||||
chalk.yellow(`⚠️ WARNING: Using experimental RSPack dev server.`),
|
||||
);
|
||||
}
|
||||
|
||||
const publicPaths = await resolveOptionalBundlingPaths({
|
||||
entry: 'src/index-public-experimental',
|
||||
dist: 'dist/public',
|
||||
|
||||
Reference in New Issue
Block a user