Disable manualChunks

pull/1214/head
Lim Chee Aun 2025-07-15 16:43:43 +08:00
rodzic f2368c94e3
commit 11b05c20d0
1 zmienionych plików z 19 dodań i 17 usunięć

Wyświetl plik

@ -176,24 +176,26 @@ export default defineConfig({
compose: resolve(__dirname, 'compose/index.html'), compose: resolve(__dirname, 'compose/index.html'),
}, },
output: { output: {
manualChunks: (id, { getModuleInfo }) => { // NOTE: Comment this for now. This messes up async imports.
// if (id.includes('@formatjs/intl-segmenter/polyfill')) return 'intl-segmenter-polyfill'; // Without SplitVendorChunkPlugin, pushing everything to vendor is not "smart" enough
if (/tiny.*light/.test(id)) return 'tinyld-light'; // manualChunks: (id, { getModuleInfo }) => {
// // if (id.includes('@formatjs/intl-segmenter/polyfill')) return 'intl-segmenter-polyfill';
// if (/tiny.*light/.test(id)) return 'tinyld-light';
// Implement logic similar to splitVendorChunkPlugin // // Implement logic similar to splitVendorChunkPlugin
if (id.includes('node_modules')) { // if (id.includes('node_modules')) {
// Check if this module is dynamically imported // // Check if this module is dynamically imported
const moduleInfo = getModuleInfo(id); // const moduleInfo = getModuleInfo(id);
if (moduleInfo) { // if (moduleInfo) {
// If it's imported dynamically, don't put in vendor // // If it's imported dynamically, don't put in vendor
const isDynamicOnly = // const isDynamicOnly =
moduleInfo.importers.length === 0 && // moduleInfo.importers.length === 0 &&
moduleInfo.dynamicImporters.length > 0; // moduleInfo.dynamicImporters.length > 0;
if (isDynamicOnly) return null; // if (isDynamicOnly) return null;
} // }
return 'vendor'; // return 'vendor';
} // }
}, // },
chunkFileNames: (chunkInfo) => { chunkFileNames: (chunkInfo) => {
const { facadeModuleId } = chunkInfo; const { facadeModuleId } = chunkInfo;
if (facadeModuleId && facadeModuleId.includes('icon')) { if (facadeModuleId && facadeModuleId.includes('icon')) {