Include JS source maps (include_js_source_maps)
- Category:
- JavaScript
- CoreFilters:
- No
- OptimizeForBandwidth:
- No
- Risk:
- Generally safe
Preserves JavaScript source maps through minification by adding a //# sourceMappingURL= comment pointing to the original source map. Enable this if you need to debug minified JavaScript in production.
When to use it
- Not in CoreFilters: it runs only when you enable it by name.
- Risk rating on these docs: Generally safe.
Risks
The
JavaScript filters
page lists no specific risks for this filter.
If a page misbehaves with it, DisableFilters include_js_source_maps turns it off for
the scope you set it in.
Configuration
Enable it in the module configuration, at server, virtual-host or location scope:
Apache
ModPagespeedEnableFilters include_js_source_mapsnginx
pagespeed EnableFilters include_js_source_maps;IIS (pagespeed.config)
pagespeed EnableFilters include_js_source_maps
Scoping, ForbidFilters and the thresholds filters read:
Choosing filters
.
Frequently asked questions
- What does the include_js_source_maps filter do?
- Preserves JavaScript source maps through minification by adding a
//# sourceMappingURL=comment pointing to the original source map. Enable this if you need to debug minified JavaScript in production. - Is include_js_source_maps enabled by default?
- No.
include_js_source_mapsis not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name withEnableFilters. - How do I enable include_js_source_maps on Apache and nginx?
- Add
ModPagespeedEnableFilters include_js_source_mapson Apache orpagespeed EnableFilters include_js_source_maps;on nginx. On IIS, addpagespeed EnableFilters include_js_source_mapsto pagespeed.config.
Related filters
- combine_javascript — Combine JavaScript
- defer_javascript — Defer JavaScript
- extend_cache_scripts — Extend cache for scripts
- inline_javascript — Inline JavaScript
- make_show_ads_async — Async AdSense
- outline_javascript — Outline JavaScript
- rewrite_javascript_external — Minify external JavaScript
- rewrite_javascript_inline — Minify inline JavaScript
This page is drawn from the include_js_source_maps entry on JavaScript filters. Every filter in one table: PageSpeed filters.