For my specific condition I don't want to generate hash in file name for some specific files. I tried something like this, but its removing hash from .css files but not for the .js files.
build: {
target: 'es2020',
rollupOptions: {
input: {
main: fileURLToPath(new URL('./index.html', import.meta.url)),
myapp: fileURLToPath(new URL('./src/my-app.ts', import.meta.url))
},
output: {
assetFileNames: (assetInfo) => {
if (assetInfo.name?.toLocaleLowerCase().includes('myapp')) {
return 'assets/[name][extname]';
}
return 'assets/[name]-[hash][extname]';
},
},