-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
Please add 'module" entrypoint in package.json manifest to be compatible with modern web ES modules #185
Comments
All in favor 👍 Do you have any suggestion how to keep it backwards compatible? |
This comment was marked as outdated.
This comment was marked as outdated.
I'm going to make a major release making this a ESM-only module. and remove all cjs umd stuff and only use ESM It will require to change streamsaver.js into using ESM export syntax, the other files mitm.html and sw.js don't need any change. so it's just one file. Something like this needs to be added to package.json "type": "module",
"exports": {
"./*.js": "./*.js"
}, also remove the "main" entry point from package.json. i want to be explicit about what path you can import. - import streamsaver from 'streamsaver'
+ import streamsaver from 'streamsaver/StreamSaver.js' ...And the README examples needs to be updated. |
it's important to test out that this settings still works: // StreamSaver can detect and use the Ponyfill that is loaded from the cdn.
streamSaver.WritableStream = streamSaver.WritableStream
streamSaver.TransformStream = streamSaver.TransformStream
// if you decide to host mitm + sw yourself
streamSaver.mitm = 'https://example.com/custom_mitm.html' i think it will be alright if we do |
Package found! However, no web-optimized "module" entrypoint was found in its package.json manifest.
This will allow it to work with snowpack, a modern package manager for the web
The text was updated successfully, but these errors were encountered: