Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore original Vite chunk size limit #713

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,18 @@ export default defineConfig(({ mode }) => {

return {
build: {
chunkSizeWarningLimit: 900,
outDir,
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
_scrivito_extensions: resolve(__dirname, '_scrivito_extensions.html'),
},
output: {
manualChunks: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the newly created react and scrivito chunk there are still two js files in the end: main-<hex>.js and index-<hex>.js - since main-<hex>.js is quite small, can they be combined into one file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any metrics that point to having the same (or even better) performance with manual chunks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to manual Lighthouse runs it's the same. Differences are all in the < 10 ms range.

react: ['react-bootstrap', 'react-helmet-async', 'react-toastify'],
apepper marked this conversation as resolved.
Show resolved Hide resolved
scrivito: ['scrivito-neoletter-form-widgets'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FMI: Please help my understand, what this scrivito chunk means? My (maybe naive) understanding would be, that their is a chunk named scrivito, but it only contains scrivito-neoletter-form-widgets. But if I look at the resulting size it shows this:

dist/assets/scrivito-CFqY22Np.js                                     465.18 kB │ gzip: 144.80 kB

But scrivito-neoletter-form-widgets is not that big (should be ~13 kB gzipped). I assume, that it also compiles the npm package scrivito in there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it includes dependencies. Same goes for the react-* packages, since they depend on react and react-dom. We could make it explicit, but since subdependencies are also included, it doesn't really make things clearer.

},
},
},
},
define: {
Expand Down