feat(projects): 1.0 beta

This commit is contained in:
Soybean
2023-11-17 08:45:00 +08:00
parent 1ea4817f6a
commit e918a2c0f5
499 changed files with 15918 additions and 24708 deletions

View File

@ -1,26 +1,19 @@
import { fileURLToPath, URL } from 'node:url';
import { defineConfig, loadEnv } from 'vite';
import { createViteProxy, getRootPath, getSrcPath, setupVitePlugins, viteDefine } from './build';
import { getServiceEnvConfig } from './.env-config';
import { setupVitePlugins } from './build/plugins';
import { createViteProxy } from './build/config';
export default defineConfig(configEnv => {
const viteEnv = loadEnv(configEnv.mode, process.cwd()) as unknown as ImportMetaEnv;
const rootPath = getRootPath();
const srcPath = getSrcPath();
const isOpenProxy = viteEnv.VITE_HTTP_PROXY === 'Y';
const envConfig = getServiceEnvConfig(viteEnv);
const viteEnv = loadEnv(configEnv.mode, process.cwd()) as unknown as Env.ImportMeta;
return {
base: viteEnv.VITE_BASE_URL,
resolve: {
alias: {
'~': rootPath,
'@': srcPath
'~': fileURLToPath(new URL('./', import.meta.url)),
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
define: viteDefine,
plugins: setupVitePlugins(viteEnv),
css: {
preprocessorOptions: {
scss: {
@ -28,28 +21,22 @@ export default defineConfig(configEnv => {
}
}
},
plugins: setupVitePlugins(viteEnv),
define: {
BUILD_TIME: JSON.stringify(new Date().toISOString())
},
server: {
host: '0.0.0.0',
port: 3200,
port: 9527,
open: true,
proxy: createViteProxy(isOpenProxy, envConfig)
proxy: createViteProxy(viteEnv)
},
optimizeDeps: {
include: [
'@antv/data-set',
'@antv/g2',
'@better-scroll/core',
'echarts',
'swiper',
'swiper/vue',
'vditor',
'wangeditor',
'xgplayer'
]
preview: {
port: 9725
},
build: {
reportCompressedSize: false,
sourcemap: false,
sourcemap: viteEnv.VITE_SOURCE_MAP === 'Y',
commonjsOptions: {
ignoreTryCatch: false
}