mirror of
https://github.com/antebudimir/feishin.git
synced 2025-12-31 10:03:33 +00:00
add vite build for remote
This commit is contained in:
parent
74554d9725
commit
48917547b2
7 changed files with 129 additions and 196 deletions
44
remote.vite.config.ts
Normal file
44
remote.vite.config.ts
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import react from '@vitejs/plugin-react';
|
||||
import path from 'path';
|
||||
import { defineConfig, normalizePath } from 'vite';
|
||||
import { ViteEjsPlugin } from 'vite-plugin-ejs';
|
||||
|
||||
import { version } from './package.json';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
emptyOutDir: true,
|
||||
outDir: path.resolve(__dirname, './out/remote'),
|
||||
rollupOptions: {
|
||||
input: {
|
||||
favicon: normalizePath(path.resolve(__dirname, './assets/icons/favicon.ico')),
|
||||
index: normalizePath(path.resolve(__dirname, './src/remote/index.html')),
|
||||
manifest: normalizePath(path.resolve(__dirname, './src/remote/manifest.json')),
|
||||
remote: normalizePath(path.resolve(__dirname, './src/remote/index.tsx')),
|
||||
worker: normalizePath(path.resolve(__dirname, './src/remote/service-worker.ts')),
|
||||
},
|
||||
output: {
|
||||
assetFileNames: '[name].[ext]',
|
||||
chunkFileNames: '[name].js',
|
||||
entryFileNames: '[name].js',
|
||||
},
|
||||
},
|
||||
},
|
||||
plugins: [
|
||||
react(),
|
||||
ViteEjsPlugin({
|
||||
prod: process.env.NODE_ENV === 'production',
|
||||
root: normalizePath(path.resolve(__dirname, './src/remote')),
|
||||
version,
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'/@/i18n': path.resolve(__dirname, './src/i18n'),
|
||||
'/@/remote': path.resolve(__dirname, './src/remote'),
|
||||
'/@/renderer': path.resolve(__dirname, './src/renderer'),
|
||||
'/@/shared': path.resolve(__dirname, './src/shared'),
|
||||
},
|
||||
},
|
||||
root: path.resolve(__dirname, './src/remote'),
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue