-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
I'm sending a bug report
When i declare a class inside an IIFE, but class is not used, it isn't stripped by UglifyJS, because it is considered as a side effect.
var V6Engine = (function () {
function V6Engine() {
}
V6Engine.prototype.toString = function () {
return 'V6';
};
return V6Engine;
}());
The warning i get:
WARN: Side effects in initialization of unused variable V6Engine [./dist/car.bundle.js:74,4]
I suspect it is because it assigns values to the prototype.
The biggest pain point with it that it blocks tree-shaking of exported classes generated by Typescript.
Can it be fixed or is their a class declaration that is not considered a side effect?
Here is an example repository where i use UglifyJS through Webpack with Typescript.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels