wintercounter / Protip

A new generation jQuery Tooltip plugin
http://protip.rocks
MIT License
359 stars 38 forks source link

The library conflicts with other code when concatenated #15

Closed pedrocatre closed 9 years ago

pedrocatre commented 9 years ago

In my build I concatenate the files. Before I build protip works, after the build my app does not work.

For now I fixed this by putting the minified javascript content inside an iife:

(function () {
    // protip code
}());
wintercounter commented 9 years ago

This is really odd because I'm using browserify to create the bundle which has it's own IIFE wrapper. Seems like the minifier omits the last semicolon. I wanted to play with some Uglify options so i've separated the minification process from the command line version to the api version, and it seems like when using this solution it keeps the semicolon which is weird. Hopefully this solves the problem anyway, but please confirm it's working right now.

michelegera commented 9 years ago

Hi @wintercounter, I ran into a similar issue when trying to use the library via Bower, where it’s still at v0.0.1.

If I use the most recent master commit (5ace014), everything works as expected.

Would it be possible to tag a new release and distribute it on Bower?

wintercounter commented 9 years ago

Hi, sure, my fault, i've totally forgot about bower. It's fixed now. I'll integrate soon into Travis, the versions now will follow the npm package's version.

michelegera commented 9 years ago

@wintercounter thanks for the quick turnaround! Works like a charm :+1: