How to use the @dojo/webpack-contrib/build-time-render/BuildTimeRender 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 / dist.config.ts View on Github external
window.navigator.serviceWorker.register('service-worker.js');
			});
		}
	`,
				type: 'append'
			}),
		new webpack.BannerPlugin({
			banner,
			test: /^.*\.js$/i
		}),
		new CleanWebpackPlugin(['dist', 'info'], { root: output!.path, verbose: false })
	].filter((item) => item);

	if (args['build-time-render']) {
		config.plugins.push(
			new BuildTimeRender({
				...args['build-time-render'],
				entries: Object.keys(config.entry!),
				sync: args.singleBundle,
				basePath,
				baseUrl: base,
				scope: libraryName
			})
		);
	}

	config.plugins = config.plugins.map((plugin) => {
		if (plugin instanceof MiniCssExtractPlugin) {
			return new MiniCssExtractPlugin({
				filename: args.omitHash ? '[name].bundle.css' : '[name].[contenthash].bundle.css'
			});
		}
github dojo / cli-build-app / src / dev.config.ts View on Github external
return {
							loader: loaderName,
							options
						};
					}
					return loader;
				});
			}
			return rule;
		});
	}

	if (args['build-time-render']) {
		config.plugins.push(
			new BuildTimeRender({
				...args['build-time-render'],
				sync: singleBundle,
				entries: Object.keys(config.entry!),
				basePath,
				baseUrl: base,
				scope: libraryName
			})
		);
	}

	config.output = {
		...output,
		path: outputPath
	};

	return config;