MCPcopy
hub / github.com/toeverything/AFFiNE / devWithWebpack

Method devWithWebpack

tools/cli/src/bundle.ts:339–361  ·  view source on GitHub ↗
(
    pkg: Package,
    devServerConfig?: WebpackDevServerConfiguration
  )

Source from the content-addressed store, hash-verified

337 }
338
339 static async devWithWebpack(
340 pkg: Package,
341 devServerConfig?: WebpackDevServerConfiguration
342 ) {
343 process.env.NODE_ENV = 'development';
344 const logger = new Logger('bundle');
345 logger.info(`Starting webpack dev server for ${pkg.name}...`);
346
347 const config = getWebpackBundleConfigs(pkg);
348 config.parallelism = cpus().length;
349
350 const compiler = webpack(config);
351 if (!compiler) {
352 throw new Error('Failed to create webpack compiler');
353 }
354
355 const devServer = new WebpackDevServer(
356 merge({}, DEFAULT_DEV_SERVER_CONFIG, devServerConfig),
357 compiler
358 );
359
360 await devServer.start();
361 }
362
363 static async buildWithRspack(pkg: Package) {
364 process.env.NODE_ENV = 'production';

Callers 1

devMethod · 0.80

Calls 4

getWebpackBundleConfigsFunction · 0.85
mergeFunction · 0.50
infoMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected