-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add '@rollup/plugin-esm-shim' #123
Conversation
Ah, Deno is like that one dentist. I made a PR to |
Edit: added a test for dist files like suggested by iambumblehead. |
tests/dist/test-ESM.mjs
Outdated
const wasmLocation = '../../node_modules/@dlemstra/magick-native/magick.wasm'; | ||
|
||
initializeImageMagick(wasmLocation).then(() => { | ||
console.log(Magick.imageMagickVersion); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also use the features
here instead so we don't need a regex?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea!
Can we avoid using that module if |
ESM would be better yes! Vite would only use the ESM if it's available, so no CJS version needed. Package should look something like this: {
"name": "@dlemstra/magick-native",
"version": "",
"type": "module",
"exports": {
".": {
"types": "./index.d.ts",
"default": "./index.js",
},
},
"module": "./index.js",
"types": "./index.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/dlemstra/Magick.Native.git",
},
"author": "Dirk Lemstra",
"license": "Apache-2.0",
"files": [
"./index.d.ts",
"./index.js",
"magick.wasm",
"NOTICE",
],
} Note: because of |
Also; my PR to |
Do we still need the |
I have made some changes to the Magick.Native build but I did not rename the files. Can you check if that works? You can use version |
A new attempt at getting both ESM and UMD builds to play well!