Builder breaks with package managers that don't hoist (e.g. pnpm) #55
Description
I recently tried to upgrade from version 0.0.8 to 0.0.10 on my repo, which is using pnpm as its package manager.
pnpm does not hoist dependencies (so, for example, storybook's dependencies are not available in the project's top level node_modules).
When starting a project with storybook-builder-vite and pnpm, we see this error: Error: Failed to resolve force included dependency: airbnb-js-shims
, which is one of the forced optimized dependencies here: https://github.com/eirslett/storybook-builder-vite/blob/main/packages/storybook-builder-vite/optimizeDeps.js
I'm confused because:
- this used to work in 0.0.8 and
airbnb-js-shims
was in that list there require.resolve("airbnb-js-shims")
shouldn't work from this file in pnpm, based on my understanding of node module resolution and pnpm. It is resolving, so something is wrong with my understanding
Manually installing airbnb-js-shims fixes this error, but it is replaced with the next one down the list.
Reproduction here: https://github.com/Pinpickle/storybook-builder-vite-0.0.10-pnpm-bug (you can run it under pnpm and yarn to see it breaking and working)
Activity