Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try again with proper build #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Try again with proper build #7

wants to merge 1 commit into from

Conversation

tomayac
Copy link
Owner

@tomayac tomayac commented Apr 4, 2022

@connorjclark This is a second attempt. I guess I simply don't get what to do with Module. I tried to follow this example, but not sure it's applicable.

The main idea is to get rid of this hack, where I append export { potrace, ready as init }; to the output:

"terser": "shx echo \"export { potrace, ready as init };\" >> ./dist/temp.js && npx terser --compress --mangle --comments /@license/ --ecma 8 --module --output ./dist/index.js -- ./dist/temp.js && shx rm ./dist/temp.js && shx cp ./src/index.d.ts ./dist/index.d.ts",

The proper way to get a module seems to be -s "MODULARIZE=1" -s "EXPORT_ES6=1".

@tomayac tomayac mentioned this pull request Apr 4, 2022
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