mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
add cloudflare workers support for all frontends (#366)
This commit is contained in:
@@ -5,3 +5,6 @@ dist-ssr
|
||||
*.local
|
||||
.env
|
||||
.env.*
|
||||
|
||||
.wrangler
|
||||
.dev.vars*
|
||||
@@ -4,7 +4,7 @@
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite --port 3001",
|
||||
"build": "vite build && tsc",
|
||||
"build": "vite build",
|
||||
"serve": "vite preview",
|
||||
"test": "vitest run"
|
||||
},
|
||||
@@ -21,7 +21,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.7.2",
|
||||
"vite": "^6.0.11",
|
||||
"vite": "^7.0.2",
|
||||
"vite-plugin-solid": "^2.11.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import { routeTree } from "./routeTree.gen";
|
||||
import "./styles.css";
|
||||
{{#if (eq api "orpc")}}
|
||||
import { QueryClientProvider } from "@tanstack/solid-query";
|
||||
import { queryClient } from "./utils/orpc";
|
||||
import { orpc, queryClient } from "./utils/orpc";
|
||||
{{/if}}
|
||||
|
||||
const router = createRouter({
|
||||
@@ -12,6 +12,9 @@ const router = createRouter({
|
||||
defaultPreload: "intent",
|
||||
scrollRestoration: true,
|
||||
defaultPreloadStaleTime: 0,
|
||||
{{#if (eq api "orpc")}}
|
||||
context: { orpc, queryClient },
|
||||
{{/if}}
|
||||
});
|
||||
|
||||
declare module "@tanstack/solid-router" {
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
|
||||
import solidPlugin from "vite-plugin-solid";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import path from "node:path";
|
||||
{{#if (includes addons "pwa")}}
|
||||
import { VitePWA } from "vite-plugin-pwa";
|
||||
{{/if}}
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
TanStackRouterVite({ target: "solid", autoCodeSplitting: true }),
|
||||
solidPlugin(),
|
||||
tailwindcss(),
|
||||
{{#if (includes addons "pwa")}}
|
||||
VitePWA({
|
||||
registerType: "autoUpdate",
|
||||
manifest: {
|
||||
name: "{{projectName}}",
|
||||
short_name: "{{projectName}}",
|
||||
description: "{{projectName}} - PWA Application",
|
||||
theme_color: "#0c0c0c",
|
||||
},
|
||||
pwaAssets: {
|
||||
disabled: false,
|
||||
config: true,
|
||||
},
|
||||
devOptions: {
|
||||
enabled: true,
|
||||
},
|
||||
}),
|
||||
{{/if}}
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
},
|
||||
},
|
||||
});
|
||||
18
apps/cli/templates/frontend/solid/vite.config.ts.hbs
Normal file
18
apps/cli/templates/frontend/solid/vite.config.ts.hbs
Normal file
@@ -0,0 +1,18 @@
|
||||
import { defineConfig } from "vite";
|
||||
import { tanstackRouter } from "@tanstack/router-plugin/vite";
|
||||
import solidPlugin from "vite-plugin-solid";
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import path from "node:path";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
tanstackRouter({ target: "solid", autoCodeSplitting: true }),
|
||||
solidPlugin(),
|
||||
tailwindcss(),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user