import { defineConfig } from 'vite'
import { resolve } from 'path'
import { sceneStylePlugin } from './src/plugins/scene-style-plugin.js'

export default defineConfig({
  root: resolve(__dirname, 'template-example'),
  build: {
    outDir: resolve(__dirname, 'dist-template'),
    assetsDir: 'assets'
  },
  plugins: [
    sceneStylePlugin()
  ],
  server: {
    host: '0.0.0.0',
    port: 3003,
    open: '/index.html'
  },
  resolve: {
    alias: {
      '@': resolve(__dirname, 'src'),
      'PE': resolve(__dirname, 'src/index.js')
    }
  },
  define: {
    '__PE_VERSION__': JSON.stringify('1.0.0')
  }
})