diff --git a/api/dev/states/myservers.cfg b/api/dev/states/myservers.cfg index a505dc733..4c20e4ba3 100644 --- a/api/dev/states/myservers.cfg +++ b/api/dev/states/myservers.cfg @@ -21,4 +21,4 @@ dynamicRemoteAccessType="DISABLED" [upc] apikey="unupc_fab6ff6ffe51040595c6d9ffb63a353ba16cc2ad7d93f813a2e80a5810" [connectionStatus] -minigraph="ERROR_RETRYING" +minigraph="PRE_INIT" diff --git a/api/tsconfig.json b/api/tsconfig.json index 844d9caac..a7e37bebb 100644 --- a/api/tsconfig.json +++ b/api/tsconfig.json @@ -2,8 +2,9 @@ "include": [ "src/**/*", ".eslintrc.ts", - "vite.config.ts" -, "unraid-api-cli.js" ], + "vite.config.ts", + "unraid-api-cli.js" + ], "exclude": [ "node_modules", "vite.config.ts" diff --git a/api/vite.config.ts b/api/vite.config.ts index 96bcbaade..8bc3a4b43 100644 --- a/api/vite.config.ts +++ b/api/vite.config.ts @@ -6,8 +6,7 @@ import { viteStaticCopy } from 'vite-plugin-static-copy'; import nodeResolve from '@rollup/plugin-node-resolve'; import { VitePluginNode } from 'vite-plugin-node'; - -export default defineConfig(() => { +export default defineConfig(({ mode }) => { return { plugins: [ tsconfigPaths(), @@ -17,14 +16,16 @@ export default defineConfig(() => { viteStaticCopy({ targets: [{ src: 'src/graphql/schema/types', dest: '' }], }), - ...VitePluginNode({ - adapter: ({ app, req, res }) => { - // Example adapter code to run src/index.ts with VitePluginNode - app(req, res); - }, - appPath: 'src/index.ts', - initAppOnBoot: true, - }) + ...(mode === 'development' + ? VitePluginNode({ + adapter: ({ app, req, res }) => { + // Example adapter code to run src/index.ts with VitePluginNode + app(req, res); + }, + appPath: 'src/index.ts', + initAppOnBoot: true, + }) + : []), ], define: { 'process.env': 'process.env', @@ -36,8 +37,8 @@ export default defineConfig(() => { 'pty.js', 'term.js', 'class-transformer/storage', - 'unicorn-magic' - ] + 'unicorn-magic', + ], }, build: { sourcemap: true, @@ -49,6 +50,7 @@ export default defineConfig(() => { }, output: { entryFileNames: '[name].js', + format: 'es', // Change the format to 'es' to support top-level await }, }, modulePreload: false,