Minified jqlite does not work in browser
Closed this issue · 1 comments
fidian commented
The minified version runs code like this (pretty printed):
!function(t, e) {
var n = e(t);
"object" == ("undefined" == typeof module ? "undefined" : _typeof(module)) && "object" == ("undefined" == typeof exports ? "undefined" : _typeof(exports)) ? module.exports = n : ("function" == typeof define ? define("jqlite", function() {
return n
}) : "function" == typeof angular ? angular.module("jqlite", []).constant("jqlite", n) : t.jqlite = n,
t.$ || (t.$ = n))
}(void 0, function(t) {
So, to explain a bit, the function's t
parameter is void 0
a.k.a undefined
. Near the end of the function, assuming we're not using Angular, the code that is executed is t.jqlite = n
and that throws an exception.
Uncaught TypeError: Cannot set property 'jqlite' of undefined
The unminified code is passing this
instead of void 0
, so the minification process is breaking the code.
fidian commented
Please disregard. This error was introduced by my build system and is not present in the minified file. My apologies.