Skip to main content

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_maps

nginx

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_maps is not in CoreFilters, the default RewriteLevel; it runs only when you enable it by name with EnableFilters.
How do I enable include_js_source_maps on Apache and nginx?
Add ModPagespeedEnableFilters include_js_source_maps on Apache or pagespeed EnableFilters include_js_source_maps; on nginx. On IIS, add pagespeed EnableFilters include_js_source_maps to pagespeed.config.

This page is drawn from the include_js_source_maps entry on JavaScript filters. Every filter in one table: PageSpeed filters.

Search