diff --git a/playground/slicemachine.config.json b/playground/slicemachine.config.json new file mode 100644 index 0000000..f2aed13 --- /dev/null +++ b/playground/slicemachine.config.json @@ -0,0 +1,3 @@ +{ + "foo": "bar" +} \ No newline at end of file diff --git a/src/devtools/index.ts b/src/devtools/index.ts index 5d6a6d6..976af18 100644 --- a/src/devtools/index.ts +++ b/src/devtools/index.ts @@ -1,4 +1,5 @@ import { existsSync } from 'node:fs' +import { readFile } from 'node:fs/promises' import { extendServerRpc, onDevToolsInitialized, startSubprocess } from '@nuxt/devtools-kit' import type { Resolver } from '@nuxt/kit' @@ -71,7 +72,7 @@ export const setupDevToolsUI = (nuxt: Nuxt, resolver: Resolver) => { const configPath = resolve(nuxt.options.rootDir, 'slicemachine.config.json') if (existsSync(configPath)) { - return await import(configPath) + return JSON.parse(await readFile(configPath, 'utf-8')) } return null