madskristensen / BundlerMinifier

Visual Studio extension
Other
615 stars 172 forks source link

//# sourceURL comments are being stripped by minifier #110

Open stevencowles opened 8 years ago

stevencowles commented 8 years ago

Installed product versions

//# sourceURL comments are being stripped by Minifier

Steps to recreate

  1. Create a Javascript file with a //# sourceURL comment.
  2. Minify.
  3. Comment is not in the minified version.

    Current behavior

//# sourceURL comments are being stripped by Minifier. As such, when the minimised Javascript file is then loaded dynamically, there's no easy way to find it using the browser debugging tools. Embedding it within an important comment doesn't work for Chrome Version 49.0.2623.110 m (haven't tested other browsers, but I would expect similar behavior).

Expected behavior

The //# sourceURL comment should be retained in a similar way that important javascript comments /! / currently are.

ssougnez commented 8 years ago

Hi,

what is it supposed to do ? Preserve the //#sourceUrl comment for every file or create a new one for the minified file?

With the option 1, if you minify 3 files, you'll get 3 //#sourceUrl pointing to these files (I'm not sure that Google developer dashboard can handle this). With the option 2, if you minify 3 files, you'll get 1 //#sourceUrl pointing to the bundled file.

Which option do you expect?

stevencowles commented 8 years ago

Isn't that bundling, rather than minification?

When bundled, they should be stripped. When minifying a single file -- It would be handy for debugging purposes to leave them in.

Icestorm0141 commented 8 years ago

I concur with @stevencowles. If you're minifying a single file, it would be helpful if the //#sourceURL weren't removed

rgelb commented 4 years ago

Was there ever a resolution to this issue?