Skip to content

Commit 17a48a6

Browse files
authored
fix(astro): optimize CJS dependency picomatch (#406)
1 parent a4bbe78 commit 17a48a6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/astro/src/index.ts

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

0 commit comments

Comments
 (0)