Skip to content

Commit

Permalink
Compile ParaglideJS on build
Browse files Browse the repository at this point in the history
  • Loading branch information
aaroncox committed Jul 16, 2024
1 parent 18db3bb commit da6bd7a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Binary file modified bun.lockb
Binary file not shown.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
"private": true,
"scripts": {
"dev": "vite dev",
"build": "vite build",
"build": "npx @inlang/paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide && vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"clean": "rm -rf ./.svelte-kit ./node_modules ./src/paraglide",
"lint": "prettier --check . && eslint .",
"format": "prettier --write ."
},
"devDependencies": {
"@inlang/paraglide-js": "1.11.2",
"@inlang/paraglide-sveltekit": "0.11.0",
"@inlang/paraglide-vite": "^1.2.74",
"@sveltejs/adapter-auto": "^3.2.2",
"@sveltejs/adapter-cloudflare": "^4.6.1",
"@sveltejs/kit": "^2.5.18",
Expand Down
8 changes: 7 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { paraglide } from '@inlang/paraglide-sveltekit/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import path from 'node:path';

export default defineConfig({
plugins: [paraglide({ project: './project.inlang', outdir: './src/lib/paraglide' }), sveltekit()]
plugins: [paraglide({ project: './project.inlang', outdir: './src/lib/paraglide' }), sveltekit()],
resolve: {
alias: {
$paraglide: path.resolve(__dirname, './src/paraglide')
}
}
});
1 change: 1 addition & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
compatibility_flags = ["nodejs_compat"]

0 comments on commit da6bd7a

Please sign in to comment.