generated from avior/template-web-astro
change some defaults
This commit is contained in:
78
astro.config.ts
Normal file
78
astro.config.ts
Normal file
@ -0,0 +1,78 @@
|
||||
import svelte from '@astrojs/svelte'
|
||||
import tailwind from "@astrojs/tailwind"
|
||||
import { defineConfig } from 'astro/config'
|
||||
import routing from './hooks/routing'
|
||||
|
||||
// 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: [svelte(), tailwind(), routing()],
|
||||
|
||||
// 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,
|
||||
}
|
||||
}
|
||||
})
|
Reference in New Issue
Block a user