KidkArolis / jetpack

🚀 Jetpack – Webpack made more convenient.
1.31k stars 30 forks source link

Fix bug resolving React modules using exports syntax #96

Closed mattliving closed 2 years ago

mattliving commented 2 years ago

import { createRoot } from 'react-dom/client'

would error with: Parsed request is a module using description file: /Users/mattliv/humaans/humaans/package.json (relative path: ./app/client/core) aliased with mapping 'react-dom': '/Users/mattliv/humaans/humaans/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/index.js' to '/Users/mattliv/humaans/humaans/node_modules/.pnpm/react-dom@18.2.0_react@18.2.0/node_modules/react-dom/index.js/client'

because require-relative package doesn't know how to correctly map browser exports

mattliving commented 2 years ago

Note: tested still works with React <=17