Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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'
});
}
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;