import { defineConfig } from 'vite';
import vituum from 'vituum';
import pug from '@vituum/vite-plugin-pug';
import twig from '@vituum/vite-plugin-twig';
import { resolve } from 'path';
import basicSsl from '@vitejs/plugin-basic-ssl';

export default defineConfig({
  plugins: [
    vituum(),

    pug({
      root: './src'
    }),

    twig({
      root: './src',
      namespaces: {
        layouts: './src/layouts',
        components: './src/components'
      }
    }),

    basicSsl()
  ],

  server: {
    host: true,
    port: 3000,
    https: true,
    open: true
  },

  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `
          @import "./src/styles/_vars.scss"; 
          @import "./src/styles/_scss";
        `
      }
    }
  },

  resolve: {
    alias: {
      '@': resolve(process.cwd(), 'src')
    }
  }
});
