feat!: sveltekit 3 with the official bun adapter, config lives in vite.config; biome unpinned at 2.5.15, anchor content check off for svelte; bun image pinned to the 1 tag
This commit is contained in:
1 parent
5cee5f99e9
commit
6c9d5063b9
11 files changed
+89
-85
No files matched your search
@@ -0,0 +1,51 @@
|
||||
{% if frontend_adapter == 'bun' -%}
|
||||
import adapter from "@sveltejs/adapter-bun";
|
||||
import { sveltekit } from "@sveltejs/kit/vite";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import { defineConfig } from "vite";
|
||||
|
||||
const PATH_SEP = /[/\\]/;
|
||||
{%- else -%}
|
||||
import adapter from "@sveltejs/adapter-static";
|
||||
import { sveltekit } from "@sveltejs/kit/vite";
|
||||
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import { defineConfig } from "vite";
|
||||
{%- endif %}
|
||||
|
||||
const allowedHosts = process.env.ALLOWED_HOSTS
|
||||
? process.env.ALLOWED_HOSTS.split(",")
|
||||
: undefined;
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
sveltekit({
|
||||
{%- if frontend_adapter == 'bun' %}
|
||||
adapter: adapter(),
|
||||
compilerOptions: {
|
||||
runes: ({ filename }) =>
|
||||
filename.split(PATH_SEP).includes("node_modules") ? undefined : true,
|
||||
},
|
||||
{%- else %}
|
||||
adapter: adapter({
|
||||
assets: "build",
|
||||
fallback: "index.html",
|
||||
pages: "build",
|
||||
precompress: false,
|
||||
strict: false,
|
||||
}),
|
||||
preprocess: [vitePreprocess()],
|
||||
{%- endif %}
|
||||
}),
|
||||
],
|
||||
server: {
|
||||
allowedHosts,
|
||||
proxy: {
|
||||
"/api": {
|
||||
changeOrigin: true,
|
||||
target: process.env.API_PROXY_TARGET ?? "http://localhost:8080",
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in new issue
Block a user