Skip to content

Commit

Permalink
Merge 433757d into 8b5eed3
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 24, 2024
2 parents 8b5eed3 + 433757d commit f6c8ac8
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions packages/bundler-vite/src/plugins/vuepressMainPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,13 @@ import 'vuepress/client-app'
)
}

// vuepress related packages that include pure esm client code,
// vuepress plugins and theme should include pure esm client code,
// which should not be optimized in dev mode, and should not be
// externalized in build ssr mode
const clientPackages = [
'@vuepress/client',
...app.pluginApi.plugins
// the 'user-config' plugin is created by cli internally
.filter(({ name }) => name !== 'user-config')
.map(({ name }) => name),
]
const clientPackages = app.pluginApi.plugins
// the 'user-config' plugin is created by cli internally
.filter(({ name }) => name !== 'user-config')
.map(({ name }) => name)

let postcssPlugins: AcceptedPlugin[]
try {
Expand Down Expand Up @@ -104,11 +101,20 @@ import 'vuepress/client-app'
minify: isServer ? false : !app.env.isDebug,
},
optimizeDeps: {
exclude: clientPackages,
exclude: [
// vuepress/client and vuepress/shared are pure esm packages
'vuepress/client',
'vuepress/shared',
...clientPackages,
],
},
ssr: {
format: 'esm',
noExternal: clientPackages,
noExternal: [
// vuepress package must not be externalized so that alias in vuepress/client could be resolved
'vuepress',
...clientPackages,
],
},
}
},
Expand Down

0 comments on commit f6c8ac8

Please sign in to comment.