Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const filesGenerator = getFilesGenerator(service, {
RoutesManager,
mountElementId: config.mountElementId,
});
filesGenerator.generate();
if (process.env.HTML !== 'none') {
const HtmlGeneratorPlugin = require('../getHtmlGeneratorPlugin').default(
service,
);
// move html-webpack-plugin to the head, so that other plugins (like workbox-webpack-plugin)
// which listen to `emit` event can detect assets
service.webpackConfig.plugins.unshift(new HtmlGeneratorPlugin());
}
require('af-webpack/build').default({
cwd,
webpackConfig: service.webpackConfig,
onSuccess({ stats }) {
debug('Build success');
if (process.env.RM_TMPDIR !== 'none') {
debug(`Clean tmp dir ${service.paths.tmpDirPath}`);
rimraf.sync(paths.absTmpDirPath);
}
service.applyPlugins('onBuildSuccess', {
args: {
stats,
},
});
debug('Build success end');
},
onFail({ err, stats }) {