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

dev: enable sourceMaps for better debugging experience #2470

Open
pranshuchittora opened this issue Mar 2, 2020 · 0 comments
Open

dev: enable sourceMaps for better debugging experience #2470

pranshuchittora opened this issue Mar 2, 2020 · 0 comments

Comments

@pranshuchittora
Copy link

Description

Trying to discuss the need for sourceMaps for better debugging.

Current behaviour

The build doesn't generate any source maps as of now (correct me if I am wrong).
Hence it's very hard to debug code using breakpoints.

Expected behaviour

Enabling source maps to enable synchronisation of the breakpoints between the source files & build files.

Suggested Approach

Enabling "sourceMaps": "inline" in the babelrc to enable source maps.
But the build size has been increased significantly
(Source maps enabled)

     *.js x135 | 1908.47 KB
    *.mjs x135 | 1868.78 KB
*.js.flow x135 |  561.75 KB
   *.d.ts x106 |  152.89 KB
     README.md |    5.36 KB
       LICENSE |    1.05 KB
  package.json |    0.61 KB
---------------------------
         Total |    4.39 MB

(Original build size without source maps)

     *.js x135 | 600.55 KB
*.js.flow x135 | 561.75 KB
    *.mjs x135 | 517.53 KB
   *.d.ts x106 | 152.89 KB
     README.md |   5.36 KB
       LICENSE |   1.05 KB
  package.json |   0.61 KB
--------------------------
         Total |   1.80 MB

This issue can be solved by providing an interface to create two builds i.e. prod (the one without source maps) & dev (the one with source maps)

Future prospects

After migrating to TS #2104 the approach can be different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant