Skip to content

Commit 6602020

Browse files
committed
fix(module): transpile websocket for production
1 parent df504c2 commit 6602020

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/module.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,16 @@ export default defineNuxtModule<ModuleOptions>({
158158
options.references.push({ path: resolve(nuxt.options.buildDir, 'types/supabase.d.ts') })
159159
})
160160

161-
// Optimize cross-fetch and websocket
161+
// Optimize cross-fetch
162162
extendViteConfig((config) => {
163163
config.optimizeDeps = config.optimizeDeps || {}
164164
config.optimizeDeps.include = config.optimizeDeps.include || []
165-
config.optimizeDeps.include.push('cross-fetch', 'websocket')
165+
config.optimizeDeps.include.push('cross-fetch')
166166
})
167+
168+
// Transpile websocket only for non dev environments
169+
if (!nuxt.options.dev) {
170+
nuxt.options.build.transpile.push('websocket')
171+
}
167172
}
168173
})

0 commit comments

Comments
 (0)