Skip to content

Conversation

@timdown
Copy link
Contributor

@timdown timdown commented Jul 12, 2022

The built dist/index.js contains /*@__PURE__*/ annotations, as mentioned in the CM buildhelper README:

NOTE: This tool will add a /*@__PURE__*/ annotation in front of every top-level function call, to allow tree-shaking of things like Facet.define(...). This is likely to break some styles of code (which, say, uses a side-effecting helper function to build up some top-level data structure), but I wasn't able to find another approach for working with the crude current state of JS dead-code detection tools.

In particular, dist/index.js contains the following lines:

for (let i in emacsKeys) {
    /*@__PURE__*/EmacsHandler.bindKey(i, emacsKeys[i]);
}

When fed through Terser (as webpack does, for example), the bindKey() call is removed and none of the key bindings work.

This PR changes the build to use Marijn's buildtool, which has an option to omit the /*@__PURE__*/ annotations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant