mirror of
https://github.com/woutdp/live_svelte
synced 2026-05-24 01:18:53 +00:00
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
import { defineConfig } from "vite"
|
|
import { svelte } from "@sveltejs/vite-plugin-svelte"
|
|
import liveSveltePlugin from "live_svelte/vitePlugin"
|
|
import tailwindcss from "@tailwindcss/vite"
|
|
import { fileURLToPath } from "url"
|
|
import path from "path"
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
|
|
export default defineConfig({
|
|
server: {
|
|
host: "127.0.0.1",
|
|
port: 5173,
|
|
strictPort: true,
|
|
cors: { origin: "http://localhost:4000" },
|
|
},
|
|
optimizeDeps: {
|
|
include: ["live_svelte", "phoenix", "phoenix_html", "phoenix_live_view"],
|
|
},
|
|
ssr: { noExternal: process.env.NODE_ENV === "production" ? true : undefined },
|
|
build: {
|
|
manifest: false,
|
|
ssrManifest: false,
|
|
rollupOptions: {
|
|
input: ["js/app.js", "css/app.css"],
|
|
},
|
|
outDir: "../priv/static",
|
|
emptyOutDir: true,
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
"@": ".",
|
|
live_svelte: path.resolve(__dirname, "../../assets/js/live_svelte/index.ts"),
|
|
},
|
|
},
|
|
plugins: [
|
|
tailwindcss(),
|
|
svelte({ compilerOptions: { css: "injected" } }),
|
|
liveSveltePlugin({ entrypoint: "./js/server.js" }),
|
|
],
|
|
})
|