import { fileURLToPath, URL } from 'node:url'
import { defineConfig, mergeConfig } from 'vite'
import sharedConfig from '../../shared/vite.config.js'
import glsl from 'vite-plugin-glsl'

export default defineConfig(
  mergeConfig(sharedConfig, {
    plugins: [
      glsl(),
    ],
    resolve: {
      alias: {
        '@': fileURLToPath(new URL('./src', import.meta.url)),
        '@shared': fileURLToPath(
          new URL('../../shared', import.meta.url),
        ),
      },
    },
    base: '/drops/noise-shader/',
    build: {
      outDir: '../../app/public/drops/noise-shader',
      emptyOutDir: true,
    },
  }),
)
