新增前端vue
This commit is contained in:
39
web-vue/web/vite.config.ts
Normal file
39
web-vue/web/vite.config.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
* @author ThinkGem
|
||||
*/
|
||||
import type { UserConfig, ConfigEnv } from 'vite';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import path from 'path';
|
||||
import {
|
||||
createBuildOptions,
|
||||
createCSSOptions,
|
||||
createDefineOptions,
|
||||
createEsBuildOptions,
|
||||
createServerOptions,
|
||||
createVitePlugins,
|
||||
wrapperEnv,
|
||||
} from '@jeesite/vite';
|
||||
|
||||
export default defineConfig(async ({ command, mode }: ConfigEnv) => {
|
||||
const root = process.cwd();
|
||||
const isBuild = command === 'build';
|
||||
const viteEnv = wrapperEnv(loadEnv(mode, root));
|
||||
const config: UserConfig = {
|
||||
root,
|
||||
base: viteEnv.VITE_PUBLIC_PATH,
|
||||
define: await createDefineOptions(),
|
||||
plugins: createVitePlugins(isBuild, viteEnv),
|
||||
server: createServerOptions(viteEnv),
|
||||
esbuild: createEsBuildOptions(viteEnv),
|
||||
build: createBuildOptions(viteEnv),
|
||||
css: createCSSOptions(),
|
||||
resolve: {
|
||||
alias: {
|
||||
'@jeesite/web': path.resolve(__dirname, './'),
|
||||
},
|
||||
},
|
||||
};
|
||||
return config;
|
||||
});
|
||||
Reference in New Issue
Block a user