Open p2edwards opened 1 year ago
Changing this to 'low priority' as it hasn't been an issue for other devs — nor me since the initial write-up.
Would still be cool to unify the configs, but there doesn't appear to be a pressing issue at the moment.
Description
It seems that the
.babelrc
for the Storybook 7 build is contradicting the.swcrc
with the kpi build, resulting in a regression for the dev server. (live reload or react refresh no longer works.)The scope of this issue is to restore the dev server without breaking the Storybook 7 build. Ideally, unify configs between Storybook and frontend, because that's why Storybook 7 tries to use a root-level
.babelrc
in the first place.Steps to Reproduce
Try running
npm run watch
, with and without.babelrc.json
present in the kpi source directory.Once the dev server's up, modify some frontend files and save them.
Expected behavior
npm run watch
should present a live dev server, reloading changes when frontend files are saved.Actual behavior
With
.babelrc.json
present, the live reloading no longer occurs.(But if
.babelrc.json
is absent, the storybook build fails.)Additional details
I think since swc contains affordances as a drop-in replacement for babel, it's probably reading some values from .babelrc.json, that are not the same as what's in .swcrc.
Storybook 7 might not be compatible with the 'classic' runtime (at least, that's what I remember from when I tried this earlier.)
I'd like to do what I commented here in .storybook/main.js: