fix: commit paraglide output to git; remove compile from prepare script
paraglide-js fetches its plugin from cdn.jsdelivr.net at compile time. In CI (no outbound internet access), this silently produces an empty _index.js, causing svelte-check to fail with 'not a module' errors. Fix: - Commit all generated src/lib/paraglide/ files to git (removing the auto-generated .gitignore that was hiding them) - Simplify prepare script to only run svelte-kit sync - Add separate 'npm run paraglide' script for developers to regenerate when messages/*.json source files change
This commit is contained in:
@@ -7,7 +7,8 @@
|
||||
"dev": "vite dev",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview",
|
||||
"prepare": "paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide && node -e \"const fs=require('fs'),f='./src/lib/paraglide/messages.js',c=fs.readFileSync(f,'utf8').split('\\n').filter(l=>!l.includes('export * as m')&&!l.includes('enabling auto-import')).join('\\n');fs.writeFileSync(f,c)\" && svelte-kit sync || echo ''",
|
||||
"prepare": "svelte-kit sync || echo ''",
|
||||
"paraglide": "paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide && node -e \"const fs=require('fs'),f='./src/lib/paraglide/messages.js',c=fs.readFileSync(f,'utf8').split('\\n').filter(l=>!l.includes('export * as m')&&!l.includes('enabling auto-import')).join('\\n');fs.writeFileSync(f,c)\"",
|
||||
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
||||
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user