mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-16 04:37:44 +08:00
AlasGG
This commit is contained in:
47
webapp/packages/preload/vite.config.js
Normal file
47
webapp/packages/preload/vite.config.js
Normal file
@@ -0,0 +1,47 @@
|
||||
import {chrome} from '../../.electron-vendors.cache.json';
|
||||
import {preload} from 'unplugin-auto-expose';
|
||||
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: [
|
||||
{
|
||||
find: '@common',
|
||||
replacement: join(PACKAGE_ROOT, '../common'),
|
||||
},
|
||||
],
|
||||
},
|
||||
build: {
|
||||
ssr: true,
|
||||
sourcemap: 'inline',
|
||||
target: `chrome${chrome}`,
|
||||
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: [preload.vite(), injectAppVersion()],
|
||||
};
|
||||
|
||||
export default config;
|
||||
Reference in New Issue
Block a user