1

When I use dev-mode with HMR and I open any page of my project every file in the project has separated request in Network Inspector - from several hundreds to several thousands files downloaded separately: vue-components, ts-files, js-files, css-files - all.

Why is this happening?

These should be in js-chunks, there should not be ts- and vue-files.

How to enable chunks?

no chunks

I've tried to use manualChunks in defineNuxtConfig options:

  vite: {
    build: {
      rollupOptions: {
        output: {
          manualChunks(id) {
            if (id.includes('node_modules')) {
              return id.toString().split('node_modules/')[1].split('/')[0].toString();
            }
          }
        }
      }
    },
  }

But it was of no use

0

Browse other questions tagged or ask your own question.