NextLegacy
NextLegacy
DDeno
Created by NextLegacy on 1/13/2025 in #help
Deno + SvelteKit + Paraglide | Can not run dev server using deno because of "FsWatcher"
My fix for now :deno_it_works:: vite.config.ts:
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig, Plugin } from "vite";

const paraglideCustomPlugin: Plugin = {
name: "paraglide-custom-plugin",
configureServer: () => {
(async () => {
const command = new Deno.Command(Deno.execPath(), {
args: [
"run",
"--allow-read", "--allow-env", "--allow-sys", "--allow-net", "--allow-write",
"npm:@inlang/paraglide-js",
"compile",
"--watch",
"--project", "./project.inlang",
"--outdir", "./src/lib/paraglide"
],
stdout: "inherit",
stderr: "inherit"
});

await command.output();
})();
}
};

export default defineConfig({
plugins: [
sveltekit(),
paraglideCustomPlugin
]
});
import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig, Plugin } from "vite";

const paraglideCustomPlugin: Plugin = {
name: "paraglide-custom-plugin",
configureServer: () => {
(async () => {
const command = new Deno.Command(Deno.execPath(), {
args: [
"run",
"--allow-read", "--allow-env", "--allow-sys", "--allow-net", "--allow-write",
"npm:@inlang/paraglide-js",
"compile",
"--watch",
"--project", "./project.inlang",
"--outdir", "./src/lib/paraglide"
],
stdout: "inherit",
stderr: "inherit"
});

await command.output();
})();
}
};

export default defineConfig({
plugins: [
sveltekit(),
paraglideCustomPlugin
]
});
2 replies