import { defineConfig } from 'astro/config';
import tailwind from '@astrojs/tailwind';

export default defineConfig({
  site: 'https://www.cameleer.io',
  output: 'static',
  trailingSlash: 'ignore',
  build: {
    // 'directory' outputs <page>/index.html so extensionless URLs like /pricing
    // resolve natively under Apache without MultiViews or rewrite rules.
    format: 'directory',
    assets: 'assets',
    inlineStylesheets: 'auto',
  },
  compressHTML: true,
  integrations: [
    tailwind({ applyBaseStyles: false }),
  ],
  vite: {
    build: {
      cssMinify: 'lightningcss',
      // Prevent Astro from inlining small scripts into the HTML.
      // Without this, the hero rotator script (< 4 KB) gets inlined as a
      // <script type="module"> tag, which violates CSP script-src 'self'
      // (no 'unsafe-inline'). Setting 0 forces all scripts to external files.
      assetsInlineLimit: 0,
    },
  },
});
