Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

refactor(nuxt)!: rename autoImports to imports #6864

Merged
merged 12 commits into from
Aug 23, 2022
Prev Previous commit
fix config deprecation :)
  • Loading branch information
pi0 committed Aug 23, 2022
commit 717541c2f1a32a6a59cb97fd9dc38d3d0af80c96
6 changes: 3 additions & 3 deletions packages/nuxt/src/imports/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ export default defineNuxtModule<Partial<ImportsOptions>>({
async setup (options, nuxt) {
// TODO: remove deprecation warning
// @ts-ignore
if (nuxt.options['auto-imports']) {
logger.warn('`auto-imports` is deprecated, use `imports` instead')
if (nuxt.options.autoImports) {
logger.warn('`autoImports` config is deprecated, use `imports` instead.')
// @ts-ignore
options = defu(nuxt.options['auto-imports'], options)
options = defu(nuxt.options.autoImports, options)
}

// @ts-expect-error
Expand Down
4 changes: 1 addition & 3 deletions packages/schema/src/config/_adhoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export default {
},

/** @deprecated Please use `imports` config. */
autoImports: {
dirs: []
},
autoImports: null,

/**
* Configure how Nuxt auto-imports composables into your application.
Expand Down