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

Vite build chunk size issue #117

Open
shellyear opened this issue Mar 8, 2024 · 1 comment
Open

Vite build chunk size issue #117

shellyear opened this issue Mar 8, 2024 · 1 comment

Comments

@shellyear
Copy link
Collaborator

shellyear commented Mar 8, 2024

I've created this separated issue, to solve the chunk size warning when running npm run built, since the output file's size is too big, the code splitting or other methods should be implemented to reduce it's size

Screenshot 2024-03-08 at 11 58 29
@palagdan
Copy link
Collaborator

This issue remains unresolved: GitHub Discussion #9440.

I tried two different approaches to solve it, but neither worked:

Automatically creating separate chunks:

  1. automatically make separate chunks with:
 export default defineConfig({
....
build: {
        rollupOptions: {
            output:{
                manualChunks(id) {
                    if (id.includes('node_modules')) {
                        return id.toString().split('node_modules/')[1].split('/')[0].toString();
                    }
                }
            }
        }
    }
});

However, this caused CSS issues in production:
Image

  1. Increasing the chunk size limit:
chunkSizeWarningLimit: 1600,

This did not help; the chunks still exceed the specified limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants