mirror of
https://github.com/jeffvli/feishin.git
synced 2026-07-22 10:26:33 +02:00
feat: support furigana and romaji generation on web (#2232)
* feat: support furigana and romaji generation on web
This commit is contained in:
+16
-5
@@ -1,15 +1,16 @@
|
||||
import { externalizeDepsPlugin, UserConfig } from 'electron-vite';
|
||||
import { defineConfig, externalizeDepsPlugin, UserConfig } from 'electron-vite';
|
||||
import { resolve } from 'path';
|
||||
import conditionalImportPlugin from 'vite-plugin-conditional-import';
|
||||
import dynamicImportPlugin from 'vite-plugin-dynamic-import';
|
||||
import { ViteEjsPlugin } from 'vite-plugin-ejs';
|
||||
|
||||
import { kuromojiDictionaryPlugin } from './vite.kuromoji-plugin';
|
||||
import { createReactPlugin } from './vite.react-plugin';
|
||||
|
||||
const currentOSEnv = process.platform;
|
||||
const electronRendererTarget = 'chrome87';
|
||||
|
||||
const config: UserConfig = {
|
||||
const createConfig = (isDevelopment: boolean): UserConfig => ({
|
||||
main: {
|
||||
build: {
|
||||
rollupOptions: {
|
||||
@@ -65,16 +66,26 @@ const config: UserConfig = {
|
||||
localsConvention: 'camelCase',
|
||||
},
|
||||
},
|
||||
plugins: [createReactPlugin(), ViteEjsPlugin({ web: false })],
|
||||
plugins: [
|
||||
createReactPlugin(),
|
||||
...(isDevelopment ? [kuromojiDictionaryPlugin({ emitDictionary: false })] : []),
|
||||
ViteEjsPlugin({ web: false }),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'/@/i18n': resolve('src/i18n'),
|
||||
'/@/lyrics-conversion-api': resolve(
|
||||
isDevelopment
|
||||
? 'src/renderer/features/lyrics/api/development-lyrics-conversion-api.ts'
|
||||
: 'src/renderer/features/lyrics/api/electron-lyrics-conversion-api.ts',
|
||||
),
|
||||
'/@/remote': resolve('src/remote'),
|
||||
'/@/renderer': resolve('src/renderer'),
|
||||
'/@/shared': resolve('src/shared'),
|
||||
...(isDevelopment ? { path: resolve('src/renderer/shims/path.ts') } : {}),
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
export default config;
|
||||
export default defineConfig(({ command }) => createConfig(command === 'serve'));
|
||||
|
||||
Reference in New Issue
Block a user