Skip to content

Commit

Permalink
fix: add missing CodeMirror deps to include list (#1354)
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX committed Feb 29, 2024
1 parent 6e9ee62 commit 886bfe8
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/slidev/node/plugins/extendConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ import type { ResolvedSlidevOptions } from '../options'
import { resolveImportPath, toAtFS } from '../resolver'
import { dependencies } from '../../../client/package.json'

const INCLUDE = [
...Object.keys(dependencies),
'codemirror/mode/javascript/javascript',
'codemirror/mode/css/css',
'codemirror/mode/markdown/markdown',
'codemirror/mode/xml/xml',
'codemirror/mode/htmlmixed/htmlmixed',
'codemirror/addon/display/placeholder',
]

const EXCLUDE = [
'@slidev/shared',
'@slidev/types',
Expand Down Expand Up @@ -46,7 +56,7 @@ export function createConfigPlugin(options: ResolvedSlidevOptions): Plugin {
},
optimizeDeps: {
exclude: EXCLUDE,
include: Object.keys(dependencies)
include: INCLUDE
.filter(i => !EXCLUDE.includes(i))
// We need to specify the full deps path for non-hoisted modules
.map(i => `@slidev/cli > @slidev/client > ${i}`),
Expand Down

0 comments on commit 886bfe8

Please sign in to comment.