Skip to content

Commit b657c2b

Browse files
committed
fix(astro): optimize CJS dependency picomatch
1 parent a4bbe78 commit b657c2b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/astro/src/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,16 @@ export default function createPlugin({
8787
vite: {
8888
optimizeDeps: {
8989
entries: ['!**/src/(content|templates)/**'],
90-
include: process.env.TUTORIALKIT_DEV ? [] : ['@tutorialkit/react'],
90+
include: [
91+
process.env.TUTORIALKIT_DEV && '@tutorialkit/react',
92+
93+
/**
94+
* The `picomatch` is CJS dependency used by `@tutorialkit/runtime`.
95+
* When used via `@tutorialkit/astro`, it's a transitive dependency that's
96+
* not automatically transformed.
97+
*/
98+
'> picomatch/posix.js',
99+
].filter(Boolean),
91100
},
92101
define: {
93102
__ENTERPRISE__: `${!!enterprise}`,

0 commit comments

Comments
 (0)