Skip to content

Commit

Permalink
fix(vite): exclude @prismicio/vue from pre-bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
lihbr committed Jun 5, 2023
1 parent aa5b0fa commit b95dca2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export default defineNuxtModule<PrismicModuleOptions>({
// Runtime dir boilerplate
const resolver = createResolver(import.meta.url)
nuxt.options.build.transpile.push(resolver.resolve('runtime'), '@nuxtjs/prismic', '@prismicio/vue')
nuxt.options.vite.optimizeDeps ||= {}
nuxt.options.vite.optimizeDeps.exclude ||= []
nuxt.options.vite.optimizeDeps.exclude.push('@prismicio/vue')

// Add runtime user code
const proxyUserFileWithUndefinedFallback = (filename: string, path: string, extensions = ['js', 'mjs', 'ts']) => {
Expand Down
1 change: 1 addition & 0 deletions test/__testutils__/mockedNuxtKit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const mockedNuxtKit = async () => {
srcDir: '/tmp/nuxt',
dir: { app: 'app', pages: 'pages' },
build: { transpile: [] },
vite: {},
runtimeConfig: {},
app: { head: {} },
alias: {}
Expand Down

0 comments on commit b95dca2

Please sign in to comment.