mirror of
https://github.com/unraid/api.git
synced 2026-01-04 07:29:48 -06:00
fix: no vite-node in non-dev mode
This commit is contained in:
@@ -21,4 +21,4 @@ dynamicRemoteAccessType="DISABLED"
|
||||
[upc]
|
||||
apikey="unupc_fab6ff6ffe51040595c6d9ffb63a353ba16cc2ad7d93f813a2e80a5810"
|
||||
[connectionStatus]
|
||||
minigraph="ERROR_RETRYING"
|
||||
minigraph="PRE_INIT"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user