mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-15 23:57:23 +08:00
AlasGG
This commit is contained in:
44
webapp/packages/main/vite.config.js
Normal file
44
webapp/packages/main/vite.config.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import {node} from '../../.electron-vendors.cache.json';
|
||||
import {join} from 'node:path';
|
||||
import {injectAppVersion} from '../../version/inject-app-version-plugin.mjs';
|
||||
|
||||
const PACKAGE_ROOT = __dirname;
|
||||
const PROJECT_ROOT = join(PACKAGE_ROOT, '../..');
|
||||
|
||||
/**
|
||||
* @type {import('vite').UserConfig}
|
||||
* @see https://vitejs.dev/config/
|
||||
*/
|
||||
const config = {
|
||||
mode: process.env.MODE,
|
||||
root: PACKAGE_ROOT,
|
||||
envDir: PROJECT_ROOT,
|
||||
resolve: {
|
||||
alias: {
|
||||
'/@/': join(PACKAGE_ROOT, 'src') + '/',
|
||||
'@common': join(PACKAGE_ROOT, '../common/'),
|
||||
},
|
||||
},
|
||||
build: {
|
||||
ssr: true,
|
||||
sourcemap: 'inline',
|
||||
target: `node${node}`,
|
||||
outDir: 'dist',
|
||||
assetsDir: '.',
|
||||
minify: process.env.MODE !== 'development',
|
||||
lib: {
|
||||
entry: 'src/index.ts',
|
||||
formats: ['cjs'],
|
||||
},
|
||||
rollupOptions: {
|
||||
output: {
|
||||
entryFileNames: '[name].cjs',
|
||||
},
|
||||
},
|
||||
emptyOutDir: true,
|
||||
reportCompressedSize: false,
|
||||
},
|
||||
plugins: [injectAppVersion()],
|
||||
};
|
||||
|
||||
export default config;
|
||||
Reference in New Issue
Block a user