Loading Sourcemaps for own Library in Webpack 4
See original GitHub issueI 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:
- Created 5 years ago
- Reactions:5
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 buteval-source-map
does. I suspect you need the “original source” devtools options.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.