-
-
Notifications
You must be signed in to change notification settings - Fork 40
ExcludeUnusedElements plugin + loader added #39
Conversation
@@ -19,5 +19,6 @@ | |||
"dependencies": { | |||
}, | |||
"devDependencies": { | |||
"htmlparser2": "^3.9.2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
htmlparser2 must be installed by the postinstall script. Without that we get runtime errors on user machines since the module is required by our plugin.
// | ||
} | ||
|
||
exports.ExcludeUnusedElements.prototype = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest we rename this to ExcludeUnusedElementsPlugin
. Other plugins use the same suffix.
} | ||
|
||
exports.ExcludeUnusedElements.prototype = { | ||
apply: function (compiler) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just exports.ExcludeUnusedElementsPlugin.prototype.apply = function...
?
|
||
if (result.context.indexOf("tns-core-modules") === -1) { | ||
if (result.contextInfo.issuer && | ||
result.contextInfo.issuer.indexOf("element-registry") !== -1 && global["ELEMENT_REGISTRY"][result.request] && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
global["ELEMENT_REGISTRY"][result.request] && !global["ELEMENT_REGISTRY"][result.request]
I think we need just !global["ELEMENT_REGISTRY"][result.request]
} | ||
} | ||
|
||
if (result.contextInfo.issuer.indexOf("bundle-entry-points") !== -1 && global["ELEMENT_REGISTRY"][result.request] && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, I think we need just !global["ELEMENT_REGISTRY"][result.request]
bfaef4c
to
aa84f58
Compare
aa84f58
to
7b5e9ac
Compare
No description provided.