I'm using Svelte and Rollup with code splitting, and here are some parts of my rollup.config.js:
input: {
'boot': 'src/boot.js',
'app': 'src/app.js',
'agency': 'src/modules/agency.js',
'buyer': 'src/modules/buyer.js',
'buyer-group': 'src/modules/buyer-group.js',
'investor': 'src/modules/investor.js',
'management-unit': 'src/modules/management-unit.js',
'platform': 'src/modules/platform.js',
'supplier': 'src/modules/supplier.js',
'tables': 'src/modules/tables.js',
'pt-BR': 'src/core/locale/pt-BR.js',
'en': 'src/core/locale/en.js',
'external-svelte-package': 'node_modules/external-svelte-package/src/index.js'
},
output: {
sourcemap: false,
format: 'esm',
dir: `${baseDir}/js`,
entryFileNames: '[name]-[hash].js',
chunkFileNames: '[name].[hash].js'
},
Rollup generates chunks with names containing hashes (e.g. investor-fa42bee8.js).
If I run build script again, with no modifications in any file of the project, all the chunks are generated with new hashes, and this behavior harms client long term cache.
How can I change this behavior and grants same hash for all chunks that are not modified?
Any help will be wlcome.
Thanks in advance.