tmeasday / storybook-skeleton

3 stars 1 forks source link

Use ESM rather than bundles in dev #5

Closed tmeasday closed 1 year ago

tmeasday commented 3 years ago

Using snowpack or similar.

tmeasday commented 3 years ago

I got snowpack running with the template in https://github.com/tmeasday/storybook-skeleton/commit/8116f9de8e35aef3bfb2847358f8a6c5a0f424bb

I think getting it to run with design-system will be more difficult for a couple of reasons:

  1. It assumes all react files have .jsx or .tsx extensions. It doesn't appear to be configurable right now. Currently the design system has some files with .tsx and others with .js. Ultimately this may not be a problem if you just navigate to the TS stories, I'm not sure. We could also change the filenames in the DS 🤷
  2. More problematically, it doesn't follow symlinks (AFAICT) and also expects node_module dependencies to be installed in the root project you are running it from. That makes our current approach sort of impossible.

We could definitely resolve the above if we are interested in seeing how it performs. In the meantime, the template provides an interesting testbed.

shilman commented 3 years ago

FWIW, I believe vite and other modern bundlers are making similar assumptions (e.g. needs jsx extension)