Closed hanxu317317 closed 6 years ago
the code after my uglify will make a bug .because of closure in
(function(t) {
d.click(function() {
o(t);
}),
r.click(function() {
o(t);
}),
a.click(function() {
o(t);
});
})(n);
@hanxu317317
(function(){
"use strict";
/* code */
}());
OR:
(function(){
"use strict";
/* code */
})();
I think I am seeing this as well. I uglify the project on my macbook and it works correctly, though when I run the same uglify task on my windows machine there are now JS errors in the project. Perhaps some downstream dependency is now breaking things? I haven't ran npm install
on the macbook in a while, while this is a new dev PC on windows.
These sound like issues in UglifyJS, have you open an issue in their project?
I have solved this problem. in my project, this is a minified js. if i uglify this file second time , the other js will be wrong like top code. i don't know why, but it's the reason.
So what happens is that you have two different versions of uglify-js
on your two machines.
The buggy version is done with uglify-js@3.3.1
, which is fixed in subsequent versions.
this is code fragment in my project
this is my gulp file
same gulp , same js, but in my pc, this is code fragment after uglify
but in my colleague pc