import { defineConfig } from 'vite'
import { createVuePlugin } from 'vite-plugin-vue2'
import Components from 'unplugin-vue-components/vite'
import { ElementUiResolver } from 'unplugin-vue-components/resolvers'

import './vite.init'
import { resolve } from 'path'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [createVuePlugin({ jsx: true }), Components({ resolvers: [ElementUiResolver()] })],
  resolve: {
    alias: {
      '@datago/components': resolve(__dirname, '../packages/components'),
      '@datago/utils': resolve(__dirname, '../packages/utils/index.ts'),
      '@datago/monitor': resolve(__dirname, '../packages/monitor/index.ts'),
    },
  },
})
