From 22d8e131fa8e5488858f09e9668c9fda33cbaddf Mon Sep 17 00:00:00 2001 From: Hubert Lin Date: Mon, 21 Oct 2024 21:55:06 -0600 Subject: [PATCH] fix: use ahead of time compile --- dev.ts | 5 ++--- fresh.config.ts | 10 ++++++++++ main.ts | 17 ++--------------- 3 files changed, 14 insertions(+), 18 deletions(-) create mode 100644 fresh.config.ts diff --git a/dev.ts b/dev.ts index 2d85d6c..029ac0d 100755 --- a/dev.ts +++ b/dev.ts @@ -1,5 +1,4 @@ -#!/usr/bin/env -S deno run -A --watch=static/,routes/ - import dev from "$fresh/dev.ts"; +import config from "./fresh.config.ts"; -await dev(import.meta.url, "./main.ts"); +await dev(import.meta.url, "./main.ts", config); \ No newline at end of file diff --git a/fresh.config.ts b/fresh.config.ts new file mode 100644 index 0000000..9c42c42 --- /dev/null +++ b/fresh.config.ts @@ -0,0 +1,10 @@ +import { defineConfig } from "$fresh/server.ts"; +import tailwind from "$fresh/plugins/tailwind.ts"; +import googleAnalyticsPlugin from "./plugins/google_analytics.ts"; + +export default defineConfig({ + plugins: [ + tailwind(), + googleAnalyticsPlugin("G-LG7XQ7H5RG"), + ], +}); \ No newline at end of file diff --git a/main.ts b/main.ts index 9b15f05..3494871 100644 --- a/main.ts +++ b/main.ts @@ -1,18 +1,5 @@ -/// -/// -/// -/// -/// - import { start } from "$fresh/server.ts"; import manifest from "./fresh.gen.ts"; +import config from "./fresh.config.ts"; -import tailwind from "$fresh/plugins/tailwind.ts"; -import googleAnalyticsPlugin from "./plugins/google_analytics.ts"; - -await start(manifest, { - plugins: [ - tailwind(), - googleAnalyticsPlugin("G-LG7XQ7H5RG"), - ], -}); +await start(manifest, config);