Skip to content

Commit

Permalink
feat: nuxt-devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
markus-gx committed Mar 20, 2023
1 parent c748987 commit 693f96d
Show file tree
Hide file tree
Showing 4 changed files with 4,595 additions and 464 deletions.
17 changes: 17 additions & 0 deletions lib/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export interface ModuleOptions {
accessToken: string,
usePlugin: boolean,
bridge: boolean, // storyblok bridge on/off
devtools: boolean, // enable nuxt/devtools integration
apiOptions: any, // storyblok-js-client options
}

Expand All @@ -23,6 +24,7 @@ export default defineNuxtModule<ModuleOptions>({
accessToken: '',
usePlugin: true,
bridge: true,
devtools: false,
apiOptions: {},
},
setup(options, nuxt) {
Expand Down Expand Up @@ -59,5 +61,20 @@ export default defineNuxtModule<ModuleOptions>({
addImports({ name, as: name, from: "@storyblok/vue" });
}
addImportsDir(resolver.resolve("./runtime/composables"));

if (options.devtools) {
// @ts-expect-error - private API
nuxt.hook('devtools:customTabs', (iframeTabs) => {
iframeTabs.push({
name: 'storyblok',
title: 'Storyblok',
icon: 'i-logos-storyblok-icon',
view: {
type: 'iframe',
src: 'https://app.storyblok.com/#!/me/spaces/'
}
})
})
}
}
});

0 comments on commit 693f96d

Please sign in to comment.