this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix vendor includes even the async import ones

+16 -3
+16 -3
vite.config.js
··· 176 176 compose: resolve(__dirname, 'compose/index.html'), 177 177 }, 178 178 output: { 179 - manualChunks: (id) => { 179 + manualChunks: (id, { getModuleInfo }) => { 180 180 // if (id.includes('@formatjs/intl-segmenter/polyfill')) return 'intl-segmenter-polyfill'; 181 - if (id.includes('tinyld/light')) return 'tinyld-light'; 182 - if (id.includes('node_modules')) return 'vendor'; 181 + if (/tiny.*light/.test(id)) return 'tinyld-light'; 182 + 183 + // Implement logic similar to splitVendorChunkPlugin 184 + if (id.includes('node_modules')) { 185 + // Check if this module is dynamically imported 186 + const moduleInfo = getModuleInfo(id); 187 + if (moduleInfo) { 188 + // If it's imported dynamically, don't put in vendor 189 + const isDynamicOnly = 190 + moduleInfo.importers.length === 0 && 191 + moduleInfo.dynamicImporters.length > 0; 192 + if (isDynamicOnly) return null; 193 + } 194 + return 'vendor'; 195 + } 183 196 }, 184 197 chunkFileNames: (chunkInfo) => { 185 198 const { facadeModuleId } = chunkInfo;