diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index 2f10d2fb..d61e04ee 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -64,6 +64,10 @@ const PURE_FUNCTIONS = new Set([ 'negate' ]) +const SIDE_EFFECT_CONSTRUCTORS = new Set([ + 'DomListener' +]) + const PURE_OR_TO_REMOVE_FUNCTIONS = new Set([ ...PURE_FUNCTIONS ]) @@ -197,7 +201,7 @@ function transformVSCodeCode (id: string, code: string) { }, visitNewExpression (path) { const node = path.node - if (node.callee.type === 'Identifier') { + if (node.callee.type === 'Identifier' && !SIDE_EFFECT_CONSTRUCTORS.has(node.callee.name)) { path.replace(addComment(node)) } this.traverse(path)