Title: Source Mapping URL
Last modified: May 23, 2017

---

# Source Mapping URL

 *  [st3llap](https://wordpress.org/support/users/st3llap/)
 * (@st3llap)
 * [9 years ago](https://wordpress.org/support/topic/source-mapping-url/)
 * Hi,
 * I’d like to add a comment at the end of my minified files pointing to their corresponding
   source maps like this:
    //# sourceMappingURL=/path/to/file.js.map
 * This is probably added in the first place and then removed when comments are 
   stripped off. Is there a way to ignore that one line?
 * The only pointer I’ve found is this:
    [https://github.com/futtta/autoptimize/issues/39](https://github.com/futtta/autoptimize/issues/39)
 * Thanks

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [9 years ago](https://wordpress.org/support/topic/source-mapping-url/#post-9160109)
 * hmmm .. afraid not [@st3llap](https://wordpress.org/support/users/st3llap/). 
   AO never adds those and the minifiers would indeed strip those out. if for debugging-
   purposes you could always request a page with `?ao_noptimize=1` appended to the
   URL, in which case the page remains un-optimized?
 *  Thread Starter [st3llap](https://wordpress.org/support/users/st3llap/)
 * (@st3llap)
 * [9 years ago](https://wordpress.org/support/topic/source-mapping-url/#post-9160306)
 * Thanks for the quick reply.
 * I want to be able to monitor exceptions using Honeybadger and it requires that
   the sourcemap is available like [that](https://github.com/honeybadger-io/honeybadger-js#sourcemaps).
 * Could you maybe point out how I would need to customize the plugin to do that
   without breaking anything? How can I access the sourcemap URL? Wouldn’t appending
   it using one of the filters work?
 * Thanks
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [9 years ago](https://wordpress.org/support/topic/source-mapping-url/#post-9160508)
 * hmm … do your original CSS/ JS files have sourcemaps in them and is the question
   just about how to keep those, or do you need AO to add them from scratch?
 *  Thread Starter [st3llap](https://wordpress.org/support/users/st3llap/)
 * (@st3llap)
 * [9 years ago](https://wordpress.org/support/topic/source-mapping-url/#post-9162854)
 * I’m afraid the minifier adds the sourcemap since it’s the one knowing the mapping
   between the original and the minified version. Minify-2.3.1-jsmin and yui-php-
   cssmin-2.4.8-4_fgo don’t seem to do that though.
 * [Uglify](https://github.com/smallhadroncollider-deprecated/uglify-php) on the
   other hand does seem to have an option to add a sourcemap. I might try to use
   this instead.
 * Thanks
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [9 years ago](https://wordpress.org/support/topic/source-mapping-url/#post-9163095)
 * the minifiers indeed don’t do that, but you might be able to tap into the AO 
   API to achieve a similar result, cfr. [https://github.com/futtta/autoptimize/issues/21#issuecomment-192255317](https://github.com/futtta/autoptimize/issues/21#issuecomment-192255317)

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Source Mapping URL’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/source-mapping-url/#post-9163095)
 * Status: not resolved