mareczek / international-phone-number

AngularJS directive implementing intl-tel-input (https://github.com/Bluefieldscom/intl-tel-input)
139 stars 132 forks source link

Remove dependency on bower_components for deployment #50

Closed kevin-abl closed 9 years ago

kevin-abl commented 9 years ago

This line is causing us problems here:

https://github.com/mareczek/international-phone-number/blob/master/src/international-phone-number.coffee#L60

We do minification and combine all our bower component js files together in a vendor.js file, and this line here then links to a file that ends up non-existent. As a result, our deployment breaks. You could possibly replicate the build step in intl-tel-input and then access the file directly?

I really like this angular module and what it does, but without this fix, we'll have to remove it from our upcoming release. :(

nitinhayaran commented 9 years ago

:+1:

reillydavis commented 9 years ago

:+1:

daveboling commented 9 years ago

:+1:

sdornan commented 9 years ago

:+1:

GLoganDR commented 9 years ago

:+1:

mareczek commented 9 years ago

Sure, I would like to help. Please describe in greater detail the requested change or simply provide a pull request. Thanks

kevin-abl commented 9 years ago

Hi @mareczek. Thanks for asking. The problem is that the link above points to a hard coded file in the bower_components directory. For most or all production deployments where we are minimizing / uglifying / concatenating javascript, we don't have files in that folder anymore, because they've been moved to a vendor.js or some other similar file. So the hard-coded link breaks the validator in these conditions.

https://github.com/mareczek/international-phone-number/blob/master/src/international-phone-number.coffee#L72

You will need a different way to load utils that doesn't point to the bower_components folder, but rather probably needs to be restructured so you can just call a class that has been loaded and will perform the same operation.

mareczek commented 9 years ago

In version 0.0.12 I added a configuration object, which you can modify in the config phase. This should solve the problem. Please confirm if possible

kevin-abl commented 9 years ago

@mareczek Thanks, I will give this a try.

kevin-abl commented 9 years ago

@mareczek obviously, you already jumped to this conclusion, but I can confirm I'm able to build with grunt and all manner of grunt-plugins successfully with this module now. Thanks a ton!

For anybody else who :+1: 'd, hit me up if you have questions about how I did it.

mareczek commented 9 years ago

@kevin-abl thanks for the reply. Just in case you would like to be proactive, please consider submitting a part of Readme.md where you could describe configuring grunt if there is anything specific. Thanks