File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import type { PluginOption } from 'vite' ;
12import type { ManifestOptions } from 'vite-plugin-pwa' ;
23
34import markdown from '@jackfranklin/rollup-plugin-markdown' ;
45import replace from '@rollup/plugin-replace' ;
6+ import { dirname , resolve } from 'node:path' ;
7+ import { fileURLToPath } from 'node:url' ;
58import { defineConfig } from 'vite' ;
69import { VitePWA } from 'vite-plugin-pwa' ;
710
811import { vitePlugins } from '../rollup-plugin/vite' ;
912
13+ const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
14+
1015const manifest : Partial < ManifestOptions > = {
1116 id : 'ComicRead' ,
1217 name : 'ComicRead' ,
@@ -62,14 +67,15 @@ export default defineConfig({
6267 generateScopedName : '[local]___[hash:base64:5]' ,
6368 } ,
6469 } ,
70+ resolve : { alias : { helper : resolve ( __dirname , '../helper' ) } } ,
6571 plugins : [
6672 replace ( {
6773 values : { isDevMode : 'false' } ,
6874
6975 preventAssignment : true ,
7076 } ) ,
7177 ...vitePlugins ,
72- markdown ( { parseFrontMatterAsMarkdown : true } ) ,
78+ markdown ( { parseFrontMatterAsMarkdown : true } ) as PluginOption ,
7379 VitePWA ( {
7480 registerType : 'autoUpdate' ,
7581 devOptions : { suppressWarnings : true } ,
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { GraphModel } from '@tensorflow/tfjs';
33import { env , loadGraphModel , setBackend } from '@tensorflow/tfjs' ;
44import { webgpu_util } from '@tensorflow/tfjs-backend-webgpu' ;
55
6- import { log , wait } from 'helper' ;
6+ import { wait } from 'helper' ;
77
88import { base64ToArrayBuffer , mainFn } from './workHelper' ;
99
@@ -24,7 +24,7 @@ export const getModel = async () => {
2424 await setBackend ( 'webgpu' ) ;
2525 } catch ( error ) {
2626 mainFn . toast . warn ( mainFn . t ( 'upscale.webgpu_tip' ) ) ;
27- log . error ( '切换 WebGPU 出错' , error ) ;
27+ mainFn . log . error ( '切换 WebGPU 出错' , error ) ;
2828 }
2929
3030 const { buffer, base64, json } = await mainFn . getModel ( ) ;
You can’t perform that action at this time.
0 commit comments