Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(nuxt): apply defaults correctly (#1934)
  • Loading branch information
sibbng committed Nov 30, 2022
1 parent 7ece58c commit cd075ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/config/src/index.ts
Expand Up @@ -14,7 +14,7 @@ export async function loadConfig<U extends UserConfig>(
): Promise<LoadConfigResult<U>> {
let inlineConfig = {} as U
if (typeof configOrPath !== 'string') {
inlineConfig = Object.assign({}, defaults, configOrPath)
inlineConfig = configOrPath
if (inlineConfig.configFile === false) {
return {
config: inlineConfig as U,
Expand Down Expand Up @@ -56,7 +56,7 @@ export async function loadConfig<U extends UserConfig>(
})

const result = await loader.load()
result.config = result.config || inlineConfig
result.config = Object.assign(defaults, result.config || inlineConfig)
if (result.config.configDeps) {
result.sources = [
...result.sources,
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/index.ts
Expand Up @@ -74,7 +74,7 @@ export default defineNuxtModule<UnocssNuxtOptions>({

nuxt.hook('vite:extend', ({ config }) => {
config.plugins = config.plugins || []
config.plugins.unshift(...VitePlugin(unoConfig))
config.plugins.unshift(...VitePlugin({}, unoConfig))
})

// Nuxt 2
Expand All @@ -90,7 +90,7 @@ export default defineNuxtModule<UnocssNuxtOptions>({

extendWebpackConfig((config) => {
config.plugins = config.plugins || []
config.plugins.unshift(WebpackPlugin(unoConfig))
config.plugins.unshift(WebpackPlugin({}, unoConfig))
})
},
})
Expand Down

0 comments on commit cd075ae

Please sign in to comment.