1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-09 16:19:03 +08:00
AzurLaneAutoScript/webapp/packages/renderer/vite.config.js

52 lines
913 B
JavaScript
Raw Normal View History

2024-06-05 23:20:28 +08:00
/* eslint-env node */
import {chrome} from '../../electron-vendors.config.json';
2025-09-03 13:59:51 +08:00
import {join} from 'path';
import {builtinModules} from 'module';
2024-06-05 23:20:28 +08:00
import vue from '@vitejs/plugin-vue';
const PACKAGE_ROOT = __dirname;
/**
* @type {import('vite').UserConfig}
* @see https://vitejs.dev/config/
*/
const config = {
mode: process.env.MODE,
root: PACKAGE_ROOT,
resolve: {
2025-09-03 13:59:51 +08:00
alias: {
'/@/': join(PACKAGE_ROOT, 'src') + '/',
},
2024-06-05 23:20:28 +08:00
},
2025-09-03 13:59:51 +08:00
plugins: [vue()],
2024-06-05 23:20:28 +08:00
base: '',
server: {
fs: {
strict: true,
},
},
build: {
sourcemap: true,
target: `chrome${chrome}`,
outDir: 'dist',
assetsDir: '.',
2025-09-03 13:59:51 +08:00
terserOptions: {
ecma: 2020,
compress: {
passes: 2,
2024-06-05 23:20:28 +08:00
},
2025-09-03 13:59:51 +08:00
safari10: false,
2024-06-05 23:20:28 +08:00
},
2025-09-03 13:59:51 +08:00
rollupOptions: {
external: [
...builtinModules,
2024-06-05 23:20:28 +08:00
],
2025-09-03 13:59:51 +08:00
},
emptyOutDir: true,
brotliSize: false,
2024-06-05 23:20:28 +08:00
},
};
export default config;