Skip to content

Commit

Permalink
fix: do not warn about refreshOnResize deprecation if not explicitl…
Browse files Browse the repository at this point in the history
…y used
  • Loading branch information
DamianGlowala committed Aug 29, 2024
1 parent 7a0a18a commit 11196cd
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ export default defineNuxtModule<ModuleOptions>({
},
version,
},
defaults: {
enabled: true,
defaultUserAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.39 Safari/537.36',
refreshOnResize: false,
},
setup(options, nuxt) {
if (typeof options.refreshOnResize === 'boolean') {
const logger = useLogger('@nuxtjs/device')
Expand All @@ -29,7 +24,11 @@ export default defineNuxtModule<ModuleOptions>({
return
}

nuxt.options.runtimeConfig.public.device = defu(nuxt.options.runtimeConfig.public.device, options)
nuxt.options.runtimeConfig.public.device = defu(nuxt.options.runtimeConfig.public.device, {
enabled: true,
defaultUserAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.39 Safari/537.36',
refreshOnResize: false,
})

const { resolve } = createResolver(import.meta.url)

Expand Down

0 comments on commit 11196cd

Please sign in to comment.