Closed alexahn closed 10 years ago
I use ngmin to handle this for me. It's part of the build process.
You do understand that anyone who uses this library will have to know to run ngmin over this library? Usually you aren't expected to run ngmin over vendor files (because it's assumed that it's written in the array format).
Minified version is part of the package. You only need to use the un-minified if you are doing development on it.
A lot of people like to have error messages that are sensible. Using a minified vendor file during development is not comforting.
Are you getting error messages from angular-toggle-switch?
No, but it could happen. Do what you want; I am merely bringing up the point that people will have to know to use the minified version if they are uglifying their entire application. Otherwise they will be met with some hard to decipher provider injection error, which if they are fortunate enough will be able to figure out by combinatorially removing vendors. For people who build SPAs, uglifying the entire application (with vendors included) as a last step is not that uncommon. That being said, some people prefer to use the un-minified vendor files during development, in case they run into any errors from these libraries. If you don't want to make this change, then don't, but I don't see what you have to lose by making it. If your source code (by declaration) can be resilient to minification/uglification, then why not do it? It seems like a best practice in the angular community to do array format injection.
+1
+1, searched for about an hour why I get injector error in production and not in development (uglification vs not)
would be better off as:
because uglification of javascript will break this library (and whatever project that uses it).