Skip to content

Suboptimal treeshaking on pure function calls #3256

Description

@intrnl

It doesn't seem like esbuild is removing these pure function calls

import { html, clone, first_child, append, define } from "@intrnl/velvet/internal";
let template0 = /*#__PURE__*/ html("<div>hello</div>");

function setup($$root, $$host) {
	let fragment0 = /*#__PURE__*/ clone(template0);

        // these are deliberately commented out, though they are relevant
	// let child0 = /*#__PURE__*/ first_child(fragment0);
	// let child1 = /*#__PURE__*/ first_child(child0);
	// append($$root, fragment0);
}

export default define("x-app", setup, {}, []);

Does it matter if the REPL has said import externalized?

REPL link

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions