import svelte from '@astrojs/svelte' import tailwind from '@astrojs/tailwind' import { defineConfig } from 'astro/config' import routing from './hooks/routing' import test from './hooks/test' import typesafeApi from './hooks/typesafe-api' import version from './hooks/version' import commantorHook from './node_modules/commantor/integrations/astro' // const faviconHook = { // name: 'Favicon', // hooks: { // "astro:build:setup": async () => { // await Manifest.create('./src/assets/favicon.png', { // name: 'Template' // }) // } // } // } const isProd = !process.env.TAURI_DEBUG // https://astro.build/config export default defineConfig({ // some settings to the build output build: { // the asset path assets: 'assets', // inline the stylesheet if it is small enough inlineStylesheets: 'auto' }, // Compress the HTML output compressHTML: isProd ? true : false, // Customizable depending on goal output: 'static', // Add TailwindCSS integrations: [typesafeApi({ output: 'src/config/api-routes.d.ts' }), test, svelte(), tailwind(), routing(), version(), commantorHook()], // prefetch links prefetch: { defaultStrategy: 'hover' }, // the site url site: 'https://example.com', // the Output server server: { host: true, port: 3000, watch: { ignored: ['**/target/**'] } }, // Remove the trailing slash by default trailingSlash: 'never', // Dev Server vite: { envPrefix: ['VITE_', 'TAURI_'], server: { watch: { // Ignore some paths ignored: [], // support polling and WSL usePolling: !!(process.env.USE_POLLING ?? process.env.WSL_DISTRO_NAME) } }, build: { target: process.env.TAURI_ENV_PLATFORM == 'windows' ? 'chrome105' : 'safari13', // don't minify for debug builds minify: isProd ? 'esbuild' : false, // produce sourcemaps for debug builds sourcemap: !isProd, } } })