• 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

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    hmmm .. afraid not @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

    (@st3llap)

    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.

    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

    (@optimizingmatters)

    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

    (@st3llap)

    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 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

    (@optimizingmatters)

    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

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Source Mapping URL’ is closed to new replies.