UNPKG

@microsoft/windows-admin-center-sdk

Version:

Microsoft - Windows Admin Center Shell

46 lines (45 loc) 2.32 kB
module.exports = { optimization: { minimize: true, runtimeChunk: 'single', splitChunks: { chunks: 'all', minSize: 16384, // in bytes maxInitialRequests: 20, cacheGroups: { msftSme: { test(module, chunks) { // separate core and angular packages into different bundle. // `module.resource` contains the absolute path of the file on disk. // Note the usage of `path.sep` instead of / or \, for cross-platform compatibility. const path = require('path'); return module.resource && !module.resource.includes(`${path.sep}node_modules${path.sep}`) && (module.resource.includes(`${path.sep}dist${path.sep}packages${path.sep}core${path.sep}`) || module.resource.includes(`${path.sep}dist${path.sep}packages${path.sep}angular${path.sep}`)); }, name(module) { const packageName = module.context.match(/[\\/]dist[\\/]packages[\\/](.*?)([\\/]|$)/)[1]; return `msftsme.${packageName}`; }, reuseExistingChunk: true }, vendor: { test(module, chunks) { // rest of packages are separated to each bundle file. // `module.resource` contains the absolute path of the file on disk. // Note the usage of `path.sep` instead of / or \, for cross-platform compatibility. const path = require('path'); return module.resource && module.resource.includes(`${path.sep}node_modules${path.sep}`); }, name(module) { const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; return `vendor.${packageName.replace('@', '')}`; }, reuseExistingChunk: true } } } } };