How to use the @dojo/webpack-contrib/registry-transformer function in @dojo/webpack-contrib

To help you get started, we’ve selected a few @dojo/webpack-contrib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dojo / cli-build-app / src / base.config.ts View on Github external
staticOnly.push('build-elide');
		entry = {
			[bootstrapEntry]: removeEmpty([
				existsSync(mainCssPath) ? mainCssPath : null,
				'@dojo/framework/shim/Promise',
				'@dojo/webpack-contrib/bootstrap-plugin/async'
			])
		};
	}

	const customTransformers: any[] = [];

	const outlets = loadRoutingOutlets();

	if ((lazyModules.length > 0 || outlets.length > 0) && !singleBundle) {
		customTransformers.push(registryTransformer(basePath, lazyModules, false, outlets));
	}

	const chunkCount = lazyModules.length + outlets.length;
	let chunkPercentageThreshold = 0;
	if (chunkCount >= 10) {
		chunkPercentageThreshold = 25;
	} else if (chunkCount >= 5) {
		chunkPercentageThreshold = 30;
	} else if (chunkCount > 0) {
		chunkPercentageThreshold = 40;
	}

	if (!isLegacy && !singleBundle) {
		customTransformers.push(importTransformer(basePath, args.bundles));
	}