Closed bashmish closed 3 months ago
Latest commit: c98a27982822ab20517c6ecc82a8ebfcd7b70414
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
What I did
@chialab/esbuild-plugin-commonjs
and use low-levelcjs-module-lexer
2nd caused a bug when I started working on MDX and created a static build of the storybook, which made React break with missing reexports like
import { createContext } from 'react';
this was due to a lack of support in@chialab/esbuild-plugin-commonjs
for conditional CommonJS reexports, specifically in this file https://www.runpkg.com/?react@18.2.0/index.jsafter hours of debugging, seeing the output of
@chialab/esbuild-plugin-commonjs
and trying to make a patch for it, I gave up an decided to try to make smth similar myself with the help of low-level tools, where https://www.npmjs.com/package/cjs-module-lexer seems to be the most mature and was used by@chialab/esbuild-plugin-commonjs
under-the-hoodI think the end result is better than the previous in all aspects (simplicity, speed and the readability of the output) and it solves the bug of MDX which I'm working on in another branch