From 97b1a85ea12499289866a6baf15661c1f15279ce Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 4 May 2023 17:18:36 +0100 Subject: [PATCH] fix: revert back to runtime app for hmr (#153) --- src/module.ts | 11 +++++------ src/runtime/types/index.d.ts | 2 -- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/module.ts b/src/module.ts index 421ce389..70e5fb45 100644 --- a/src/module.ts +++ b/src/module.ts @@ -1,11 +1,11 @@ -import { defineNuxtModule, installModule, addComponentsDir, addImportsDir, createResolver, addPlugin } from '@nuxt/kit' +import { defineNuxtModule, installModule, addComponentsDir, addImportsDir, createResolver, addPlugin, resolvePath } from '@nuxt/kit' import colors from 'tailwindcss/colors.js' import { iconsPlugin, getIconCollections } from '@egoist/tailwindcss-icons' -import { defu } from 'defu' import { name, version } from '../package.json' import { colorsAsRegex, excludeColors } from './runtime/utils/colors' + import appConfig from './runtime/app.config' -import type { DeepPartial } from './runtime/types' +type DeepPartial = Partial<{ [P in keyof T]: DeepPartial | { [key: string]: string } }> // @ts-ignore delete colors.lightBlue @@ -65,10 +65,9 @@ export default defineNuxtModule({ nuxt.options.css.push(resolve(runtimeDir, 'ui.css')) - nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui, appConfig.ui) - + const appConfigFile = await resolvePath(resolve(runtimeDir, 'app.config')) nuxt.hook('app:resolve', (app) => { - app.configs.push(resolve(runtimeDir, 'app.config')) + app.configs.push(appConfigFile) }) // @ts-ignore diff --git a/src/runtime/types/index.d.ts b/src/runtime/types/index.d.ts index b47e51f5..d3c7248f 100644 --- a/src/runtime/types/index.d.ts +++ b/src/runtime/types/index.d.ts @@ -3,5 +3,3 @@ export * from './clipboard' export * from './command-palette' export * from './popper' export * from './toast' - -export type DeepPartial = Partial<{ [P in keyof T]: DeepPartial | { [key: string]: string } }>