MCPcopy Create free account
hub / github.com/toeverything/AFFiNE / devWithRspack

Method devWithRspack

tools/cli/src/bundle.ts:408–432  ·  view source on GitHub ↗
(
    pkg: Package,
    devServerConfig?: RspackDevServerConfiguration
  )

Source from the content-addressed store, hash-verified

406 }
407
408 static async devWithRspack(
409 pkg: Package,
410 devServerConfig?: RspackDevServerConfiguration
411 ) {
412 process.env.NODE_ENV = 'development';
413 assertRspackSupportedPackage(pkg);
414
415 const logger = new Logger('bundle');
416 logger.info(`Starting rspack dev server for ${pkg.name}...`);
417
418 const config = getRspackBundleConfigs(pkg);
419 config.parallelism = cpus().length;
420
421 const compiler = rspack(config);
422 if (!compiler) {
423 throw new Error('Failed to create rspack compiler');
424 }
425
426 const devServer = new RspackDevServer(
427 merge({}, DEFAULT_DEV_SERVER_CONFIG, devServerConfig),
428 compiler
429 );
430
431 await devServer.start();
432 }
433}

Callers 1

devMethod · 0.80

Calls 5

getRspackBundleConfigsFunction · 0.85
mergeFunction · 0.50
infoMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected