import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path';
import { glob }  from 'glob';
import { createHtmlPlugin } from 'vite-plugin-html';
import AutoImport from 'unplugin-auto-import/vite';


const pathSrc = path.resolve(__dirname, './src'); // F:\webui\multiple-pages\demo\src
const devPathSrc = path.resolve(__dirname, '../../../src'); // node_modules应用下

// 模拟 utils.assetsPath 函数
const assetsPath = (dir) => path.posix.join('static', dir);

export default defineConfig({
  /** 
  plugins: [
    vue(),
    
    AutoImport({
      imports: ['vue','vuex','vue-router'],
      dts: 'src/auto-imports.d.ts'
    }),    
    createHtmlPlugin({
      minify: false,
    })
  ],*/
  // 模块解析配置
  resolve: {
    // 配置路径别名
    alias: {
        '@': path.resolve(__dirname, './node_modules/icore-frame/src'),  // 指向基础包
        '~': path.resolve(__dirname, './src') // 指向当前目录
    },
    // 导入时想要省略的扩展名列表
    extensions: ['.js', '.json', '.vue']
  },
 // root:'./',
  root: process.cwd(),
  //root:path.resolve(__dirname + '/node_modules/my-vue-app'),
  base: '/'
})
