What method does webpack use to show the sources in a 'webpack://' folder in dev tools?
Asked Answered
S

1

6

If I use webpack in dev mode, when I open chrome dev tools, in the 'sources' tab, I can see a 'webpack://' folder with all my source code.

enter image description here

I would like to know how I could do something similar with my own code (without webpack).

Let's say that I want to program my own build system. This build system takes some source code then transpiles it. How can I show the original source code (including js, html, and css files) in a special folder (for example 'mysource://')?

Supplement answered 23/3, 2019 at 6:28 Comment(1)
please check this post (i can not comment): #27627264Contrapuntist
A
4

The source code you see in your DevTool-window are so called 'source-maps', in webpack they are generated (in most cases) by the SourceMapDevToolPlugin by default when in 'dev' mode.

Here is another article about how to generate source maps.

Appaloosa answered 25/3, 2019 at 8:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.