Skip to content

Commit

Permalink
fix: temporarily disable autoregistration of components
Browse files Browse the repository at this point in the history
relates to #51
  • Loading branch information
danielroe committed Nov 18, 2020
1 parent 7f5eeba commit b5abd8d
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ const nuxtModule: Module<SanityModuleOptions> = function (moduleOptions) {
}

this.options[CONFIG_KEY] = options
const autoregister = !!this.options.components
// TODO: #51
const autoregister = false // !!this.options.components

this.addPlugin({
src: resolve(__dirname, '../templates/plugin.js'),
Expand Down Expand Up @@ -155,11 +156,12 @@ const nuxtModule: Module<SanityModuleOptions> = function (moduleOptions) {
})
}

if (autoregister) {
this.nuxt.hook('components:dirs', (dirs: string[]) => {
dirs.push(resolve(this.nuxt.options.buildDir, './sanity/components'))
})
}
// TODO: #51
// if (autoregister) {
// this.nuxt.hook('components:dirs', (dirs: string[]) => {
// dirs.push(resolve(this.nuxt.options.buildDir, './sanity/components'))
// })
// }

this.options.build.transpile = this.options.build.transpile || /* istanbul ignore next */ []
this.options.build.transpile.push(/^@nuxtjs[\\/]sanity/)
Expand Down

0 comments on commit b5abd8d

Please sign in to comment.