Files
vite_front/vite.config.ts
T
2022-07-09 19:25:02 +09:00

34 lines
927 B
TypeScript

import { defineConfig, UserConfigExport } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'node:path';
import { map } from 'lodash';
type ExportKey = 'ingame'|'ingame_vue';
type BuildExports = Record<ExportKey, Record<string,string>>;
// https://vitejs.dev/config/
export default defineConfig(({ command, mode }) => {
const target = 'hwe'; //방법이 있나?
const tsDir = resolve(__dirname, `${target}/ts/`);
const build_exports: BuildExports = require(`${tsDir}/build_exports.json`);
const ingame_vue_ts: Record<string, string> = {};
for(const [key, value] of Object.entries(build_exports.ingame_vue)){
ingame_vue_ts[key] = `${tsDir}/${value}`;
}
const config: UserConfigExport = {
build: {
rollupOptions: {
input: ingame_vue_ts,
},
outDir: resolve(__dirname, `dist_js/version/ingame_vue`),
},
plugins: [vue()]
}
return config;
})