Sanitize rollup chunk filenames for Netlify compatibility
Vite/Rollup generates chunk names with !~{} characters that cause
esbuild syntax errors on Netlify's build system. Added sanitizeFileName
to replace special characters with underscores.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
11ab6c3b9f
commit
a90cd7283c
1 changed files with 6 additions and 0 deletions
|
|
@ -27,6 +27,12 @@ export default defineConfig({
|
|||
build: {
|
||||
target: "es2022",
|
||||
minify: "esbuild",
|
||||
// Sanitize chunk filenames — Netlify esbuild chokes on ! and ~ in names
|
||||
rollupOptions: {
|
||||
output: {
|
||||
sanitizeFileName: (name) => name.replace(/[^\w./-]/g, '_'),
|
||||
},
|
||||
},
|
||||
},
|
||||
esbuild: {
|
||||
target: "es2022",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue