How to use the @dojo/webpack-contrib/static-build-loader/getFeatures 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
export default function webpackConfigFactory(args: any): webpack.Configuration {
	tsnode.register({ transpileOnly: true });
	const isLegacy = args.legacy;
	const experimental = args.experimental || {};
	const isExperimentalSpeed = !!experimental.speed && args.mode === 'dev' && !isLegacy;
	const isTest = args.mode === 'unit' || args.mode === 'functional' || args.mode === 'test';
	const singleBundle = args.singleBundle || isTest || isExperimentalSpeed;
	const watch = args.watch;
	const extensions = isLegacy ? ['.ts', '.tsx', '.js'] : ['.ts', '.tsx', '.mjs', '.js'];
	const compilerOptions = isLegacy ? {} : { target: 'es2017', module: 'esnext', downlevelIteration: false };
	let features = isLegacy ? args.features : { ...(args.features || {}), ...getFeatures('modern') };
	features = { ...features, 'dojo-debug': false };
	const staticOnly = [];
	const assetsDir = path.join(process.cwd(), 'assets');
	const assetsDirPattern = new RegExp(assetsDir);
	const lazyModules = Object.keys(args.bundles || {}).reduce(
		(lazy, key) => {
			lazy.push(...args.bundles[key]);
			return lazy;
		},
		[] as string[]
	);
	const watchExtraFiles = Array.isArray(args.watchExtraFiles) ? args.watchExtraFiles : [];
	let entry: any;
	if (!isTest) {
		features = { ...features, test: false };
	}