eduardolundgren / gulp-umd

Gulp plugin for build JavaScript files as Universal Module Definition, aka UMD
MIT License
126 stars 14 forks source link

Added source map support #14

Open WHenderson opened 9 years ago

WHenderson commented 9 years ago

The method I've used for adding source map support isn't as pure as I would like, but it will cover 90% of use cases.

Basically, I run the template using a magic number as the content. Then I replace every instance of the magic number with the actual content whilst also cloning and adjusting the incoming source map.

Take a look, see what you think.

WHenderson commented 9 years ago

How awesome is Travis? :-D

I'll sort out whatever the issue is and get this sorted.

WHenderson commented 9 years ago

Seems that something in the chain is getting confused about line endings which are then encoded in the sourcemaps. Suspicion is that something is auto-converting from unix to windows line endings.

WHenderson commented 9 years ago

Looks like my coffee test file had \r\n line endings at the time I generated the fixtures. Thus, the \r\n got "baked in" to the source map. All sorted now.

CodeMan99 commented 6 years ago

@WHenderson Hi! I am a new maintainer here. If you would still like to get this merged please fix up the merge conflicts and then I will have a look.

This will be the first time I've ever messed with source maps, so bare with me if I ask some silly questions.

WHenderson commented 6 years ago

Hi CodeMan,

I'm afraid I haven't looked at umd stuff in a considerable amount of time. I'll leave this on my radar, but I have no idea when I will get time to look at it. Is this something others have asked for?

CodeMan99 commented 6 years ago

I have not seen any recent requests. However, I can imagine sourcemaps being of higher priority compared to other features for most users.

Personally, I am in no hurry and want to let the recent releases (v1.0.0 & v2.0.0) to stew for a while anyway.