Skip to content

Commit

Permalink
fix: revert back to runtime app for hmr (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 4, 2023
1 parent 9ce43ac commit 97b1a85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src/module.ts
Original file line number Diff line number Diff line change
@@ -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<T> = Partial<{ [P in keyof T]: DeepPartial<T[P]> | { [key: string]: string } }>

// @ts-ignore
delete colors.lightBlue
Expand Down Expand Up @@ -65,10 +65,9 @@ export default defineNuxtModule<ModuleOptions>({

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
Expand Down
2 changes: 0 additions & 2 deletions src/runtime/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ export * from './clipboard'
export * from './command-palette'
export * from './popper'
export * from './toast'

export type DeepPartial<T> = Partial<{ [P in keyof T]: DeepPartial<T[P]> | { [key: string]: string } }>

0 comments on commit 97b1a85

Please sign in to comment.