-
Notifications
You must be signed in to change notification settings - Fork 3
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
default export #2
Comments
This is already done, you should be able to use the CommonJS export with a simple const isoworker = require('isoworker');
isoworker.workerize(...);
// Alternatively,
const { workerize } = require('isoworker');
workerize(...); Is this not working for you, or are you looking for some other kind of export? |
Your code is ok and I think everything is fine with CommonJS. The issue is with EcmaScript modules. In a browser or with a bundler, from a non module script, you can only import the default export of a module. The EcmaScript module version in your build should expose everything in an object as a default export. |
When trying to ues |
package.json has a |
Could you add a default export so that isoworker as EcmaScript module can be imported (so used) from a non EcmaScript module ?
The text was updated successfully, but these errors were encountered: