More robust assetsInlineLimit logic

This commit is contained in:
Kalle
2026-04-01 18:33:56 +03:00
parent 5b9e5d1f87
commit 85f837ae4e

View File

@@ -69,11 +69,11 @@ export default defineConfig(({ mode }) => {
],
},
build: {
// this is mostly done so that i18n jsons as defined in ./app/modules/i18n/loader.ts
// do not end up in the js bundle as minimized strings
// if we decide later that this is a useful optimization in some cases then we can
// switch the value to a callback one that checks the file path
assetsInlineLimit: 0,
assetsInlineLimit: (filePath: string) => {
if (/\/locales\/[^/]+\/[^/]+\.json$/.test(filePath)) return false;
return undefined;
},
sourcemap: true,
},
};