Skip to content

Commit 0f82579

Browse files
committed
fix: respect object notation of plugin registration
close #309
1 parent 90d245c commit 0f82579

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/index.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,11 @@ async function buildNuxt (options: StorybookOptions) {
116116
* Filter server-side plugins
117117
*/
118118
nuxt.options.plugins = nuxt.options.plugins.filter((plugin) => {
119-
let src = plugin
120119
if (typeof plugin === 'object') {
121-
src = plugin.src
120+
return !plugin.mode || plugin.mode === 'client'
122121
}
123122

124-
if (typeof src === 'string' && src.match(/\.server\.?(.*)\.(ts|js)/)) {
123+
if (typeof plugin === 'string' && plugin.match(/\.server\.?(.*)\.(ts|js)/)) {
125124
return false
126125
}
127126

0 commit comments

Comments
 (0)