Files
astro-tina/astro.config.mjs
Kunthawat Greethong a2cbf5207b
Some checks failed
Deploy to Easypanel / deploy (push) Has been cancelled
Fix: disable Tina CMS during build to avoid
clientId/token error
2026-04-27 20:20:34 +07:00

43 lines
1.1 KiB
JavaScript

import { defineConfig } from 'astro/config'
import tailwindcss from '@tailwindcss/vite'
import tina from 'tinacms'
import { fileURLToPath } from 'url'
import path from 'path'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
// Only enable Tina CMS when TINA_TOKEN is provided AND we're not in build mode
const isBuild = process.argv.includes('build')
const tinaEnabled = !isBuild && !!process.env.TINA_TOKEN
export default defineConfig({
site: 'https://example.com',
integrations: [
tina({
enabled: tinaEnabled,
sidebar: {
partials: [],
},
}),
],
vite: {
plugins: [tailwindcss()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
'@components': path.resolve(__dirname, './src/components'),
'@layouts': path.resolve(__dirname, './src/layouts'),
'@styles': path.resolve(__dirname, './src/styles'),
'@content': path.resolve(__dirname, './src/content'),
},
},
},
output: 'static',
build: {
assets: '_assets',
},
server: {
host: '0.0.0.0',
port: 4321,
},
})