-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add source-map-loader to support source maps of dependencies #2355
Conversation
What kinds of npm packages ship with sourcemaps? I haven't seen this before. |
I'd be interested in the speed implications of such a change with a heavy source-map laden dependency tree. |
Potentially typescript projects. |
This feature will be very helpful in case of using monorepo packages to organize several react apps and its shared components. |
Just ran into this, so here's an example: gilbarbara/react-joyride#280 FWIW I struggle with CRA including this loader--mostly worried too about build perf, but maybe it's unfounded? IMO projects shouldn't minify their Looks like the loader applies two regexes to every file, only doing IO if a sourceMapURL is found. So ultimately depends on how efficient those particular regexes are. I'm too lazy to actually test, sorry... I wonder if it's possible to only apply it to dependencies and not the app's own files. |
Just to add to what has been mentioned above with a use case, I have a monorepo with the following structure: https://github.com/penx/pcp-form-example/tree/v0.0.1 i.e. 3 node packages:
I want to have the source maps of the web-server to include the original source of application/presentational-components. The component modules (application, presentational-components) currently use ES6 modules
If I go for option 1 then I need something like |
Closing as stale. Happy to take a PR like this if people express more support. |
I'd like to advocate for this PR to be reconsidered. Our team has multiple dependency packages we maintain for use, shared between multiple create-react-app projects. They are built with https://github.com/transitive-bullshit/react-modern-library-boilerplate and published to our private npm instance. |
It seems that the source code of dependencies is not visible while debugging, but
source-map-loader
was designed to address this and seems to work well in dev mode.Has this use case come up before? There could be an alternate strategy that I'm missing.
cc @skevy who pointed me in the right direction