Skip to content
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

Load typescript source maps from library #6994

Closed
tomitrescak opened this issue May 6, 2019 · 2 comments · Fixed by #8227
Closed

Load typescript source maps from library #6994

tomitrescak opened this issue May 6, 2019 · 2 comments · Fixed by #8227
Labels

Comments

@tomitrescak
Copy link

Is this a bug report?

No

Hi, I have a typescript base monorepo project with CRA front end. I’d love to use typescript generated source maps from my libraries for debugging purposes. Unfortunately all I’m getting are compiled js files.

@tomitrescak
Copy link
Author

I figured it out, but only with "hack" / "eject".

If you do not want to eject you need to modify the webpack config in the react-scripts directory (DANGER you probably will lose CRA support after this). I wrote a simple fix.js file that modifies given entries.

  1. I enabled source maps a this line flipping false to true

ALMOST THERE

  1. You also need to add source maps loader. Install it yarn add source-map-loader and add a following code before following line
        {
          test: /\.(js|mjs|jsx|ts|tsx)$/,
          enforce: 'pre',
          use: ['source-map-loader']
        },

It would be grear to have it supported, but this should have you started

ADDITION:

I also enable inline-source-map in a devtool settings, but that might not have any effect. Still need to investigate,

@stale
Copy link

stale bot commented Jun 6, 2019

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

@stale stale bot added the stale label Jun 6, 2019
@lock lock bot locked and limited conversation to collaborators Jun 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
1 participant