Maintain your client-side rule debuggable and readable even with you have combined, minified or put together it. Use supply maps to map your supply code to your put together rule.
- Utilize supply Maps to map code that is minified supply rule. After that you can read and debug put together rule in its initial supply.
- Only utilize preprocessors with the capacity of producing supply Maps.
- Verify that your particular web host can provide Source Maps.
Begin with preprocessors
Make use of a supported preprocessor
You should utilize a minifier which is effective at creating source maps. When it comes to many options that are popular see our preprocessor help area. For the view that is extended look at Source maps: languages, tools as well as other information wiki page.
The next types of preprocessors can be found in combination with supply Maps:
Supply Maps in DevTools Sources panel
Source Maps from preprocessors cause DevTools to load your initial files as well as your ones that are minified. Afterward you make use of the originals to create breakpoints and move through rule. Meanwhile, Chrome is obviously operating your minified rule. Thus giving you the impression of running mail order bride a development web site in production.
Enable Source Maps in settings
Debugging with Source Maps
Whenever debugging your rule and Source Maps enabled, supply Maps will show in 2 places:
- Into the system (the hyperlink to supply must be the original file, perhaps perhaps not the one that is generated
- 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 in to the //# sourceMappingURL property and it is really mentioned when you look at the Source Map V3 specifications.
By like the following special comment in your rule, that will be evaled, you can easily name evals and inline scripts and designs so that they appear much more rational names in your DevTools.
Navigate to the demo, then:
- Start the DevTools and go directly to the Sources panel.
- Type in a filename to the title your rule: input industry.
- Click the compile switch.
- An alert will appear with the evaluated sum from the CoffeeScript supply.