Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
};
if (!isTestMode) {
config.plugins = config.plugins.concat([
CopyWebpackPlugin([
{ from: 'src/assets/images', to: 'assets/images' },
{ from: 'src/assets/config/config.json', to: 'assets/config' },
]),
new HtmlWebpackPlugin({
filename: './index.html',
template: INDEX_TEMPLATE_PATH,
title: APP_CONF.title,
rootElement: APP_CONF.rootElement,
rootModule: APP_CONF.rootModule,
inject: 'body',
loader: AppLoader.APP_LOADER,
// ensure loding order vendor/style/app
chunksSortMode: (a, b) => {
const aOrder = CHUNKS_ORDER.indexOf(a.names[0]);
const bOrder = CHUNKS_ORDER.indexOf(b.names[0]);
if (aOrder > bOrder) {
return 1;
}
if (aOrder < bOrder) {
return -1;
}
return 0;
},
}),
new TalendHTML({
loadCSSAsync: true,
appLoaderIcon: APP_CONF.icon,
options: {
name: './fonts/[name].[ext]',
limit: 10000,
mimetype: 'application/font-woff',
},
},
],
},
plugins: [
new MiniCssExtractPlugin({
filename: '[name]-[hash].css',
}),
new HtmlWebpackPlugin({
filename: './index.html',
template: `${process.cwd()}/src/app/index.html`,
appLoader: AppLoader.APP_LOADER,
...getUserConfig('html'),
}),
new TalendHTML({
loadCSSAsync: true,
appLoaderIcon: getUserConfig(['html', 'appLoaderIcon'], DEFAULT_APP_LOADER_ICON),
}),
new CopyWebpackPlugin([
{ from: 'src/assets' },
]),
new webpack.BannerPlugin({
banner: LICENSE_BANNER,
}),
],
};
};