question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loading Sourcemaps for own Library in Webpack 4

See original GitHub issue

I have a library MyLibrary that is loaded inside MyApp. Ever since upgrading to webpack 4, sourcemaps no longer get loaded by the app to debug into the library and only the webpack compiled code is shown. Sourcemaps for each the library and the app itself work fine.

A minimum reproducible repo can be found here: https://github.com/sqwk/webpack-library-test

Also see this Stackoverflow question about the topic: https://stackoverflow.com/questions/50910220/webpack-4-load-library-sourcemap/51253629#

Is this a configuration error or is there a known incompatibility with webpack 4?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mfedderlycommented, Jul 27, 2018

I think that this depends on the devtool setting of the final webpack step. cheap-eval-source-map doesn’t give me the sourcemaps I’m looking for but eval-source-map does. I suspect you need the “original source” devtools options.

0reactions
alexander-akaitcommented, Jul 30, 2020

When you build library for publishing you should use devtool: 'source-map' value if you want provide source maps for other developers (source-map-loader automatically loads them). Sorry it’s out of our control. In most tools for building library it is described https://webpack.js.org/configuration/devtool/#production. Anyway if you want to send a PR with docs here feel free to do it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack 4 Load Library Sourcemap - Stack Overflow
I have a library MyLib that I am loading inside MyApp . Both are compiled with webpack 4 and MyApp uses source-map-loader to...
Read more >
source-map-loader - webpack
The source-map-loader extracts existing source maps from all JavaScript entries. This includes both inline source maps as well as those linked via URL....
Read more >
Source-map-loader - Webpack 4 - W3cubDocs
This loader is especially useful when using 3rd-party libraries having their own source maps. If not extracted and processed into the source map...
Read more >
Using source-map-loader with TypeScript - inspirnathan
The source-map-loader is a very useful tool for extracting source maps from third party libraries you have installed such as those inside ...
Read more >
Compiling and bundling TypeScript libraries with Webpack
The source-map produces a production ready source map, with original code quality. The minified version will be created by the UglifyJSPlugin so we...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found