Keep your client-side rule debuggable and readable even with you have combined, minified or put together it. Utilize supply maps to map your supply rule to your put together code.
- Utilize Source Maps to map code that is minified source rule. Then you’re able to read and debug put together rule with its original supply.
- Only utilize preprocessors effective at creating supply Maps.
- Verify that the internet host can provide supply Maps.
Get started doing preprocessors
Work with a supported preprocessor
You should employ a minifier that is with the capacity of creating maps that are source. For the most options that are popular see our preprocessor help area. For an extensive view, russian bride look at supply maps: languages, tools as well as other information wiki page.
The next types of preprocessors can be utilized in combination with supply Maps:
Supply Maps in DevTools Sources panel
Source Maps from preprocessors cause DevTools to load your initial files along with your ones that are minified. After this you make use of the originals to create breakpoints and move through rule. Meanwhile, Chrome is in fact running your minified rule. This provides you the impression of managing a development web web site in manufacturing.
Enable Source Maps in settings
Debugging with Source Maps
Whenever debugging your rule and Source Maps enabled, supply Maps will show in 2 places:
- When you look at the system (the hyperlink to supply ought to be the initial file, perhaps perhaps not the generated one)
- Whenever stepping through rule (backlinks when you look at the call stack should start the initial supply file)
The@sourceURL allows you to make development much easier when working with evals while not part of the source Map spec. This helper appears virtually identical to the //# sourceMappingURL property and it is really mentioned when you look at the Source Map V3 specifications.
By like the after comment that is special your rule, which is evaled, you are able to name evals and inline scripts and styles so they really appear much more logical names in your DevTools.
Navigate for this demo, then:
- Start the DevTools and go right to the Sources panel.
- Type in a filename in to the Name your code: input industry.
- Click the compile switch.
- An alert will appear with the sum that is evaluated the CoffeeScript supply.