Skip to content

Commit

Permalink
upd: #1278; build::manualChunks homepage single;
Browse files Browse the repository at this point in the history
  • Loading branch information
migbash committed Aug 2, 2023
1 parent 4d1623d commit ab87357
Showing 1 changed file with 50 additions and 10 deletions.
60 changes: 50 additions & 10 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,56 @@ export default defineConfig
// ),
],

// DOC: REF: [6]
// build: {
// rollupOptions:
// {
// output:
// {
// manualChunks: undefined
// }
// }
// },
// ### DOC:
// ### look for reference [6]
build:
{
rollupOptions:
{
output:
{
// manualChunks: undefined

// ### SEE:
// ### https://github.com/vitejs/vite/discussions/9440#discussioncomment-5913798
manualChunks
(
id
)
{
// [🐞]
// console.log(id);

// ### NOTE:
// ### testing for 'per-page' component build split.
if (id.includes('components/page/home'))
{
// return id.toString().split('/components/page/home/')[1].split('/')[0].toString();
return 'all-homepage';
}

// ### SEE:
// ### 1st comment - https://stackoverflow.com/a/71578633/8421215
// if (id.indexOf("react") !== -1) { return; }

// ### SEE:
// ### https://github.com/sveltejs/kit/issues/7257#issuecomment-1528962348
// if (id.includes('sentry'))
// {
// return 'vendor_sentry'
// }

// ### NOTE:
// ### original
// if (id.includes('node_modules'))
// {
// return id.toString().split('node_modules/')[1].split('/')[0].toString();
// }
}

}
}
},

// ### NOTE:
// ### 'vitest' integration
Expand Down

0 comments on commit ab87357

Please sign in to comment.