feat: add ESM support#10525
Conversation
|
I think this PR also resolves this issue #9436 If we still want to support commonjs, cjs bundle from this PR has compatible with ESM exports: @benmccann What do you think? |
|
I'd love to drop CJS and do ESM-only if possible |
kurkle
left a comment
There was a problem hiding this comment.
I'm not sure how the files should be named, because I guess chart.js can't be UMD when type='module'.
kurkle
left a comment
There was a problem hiding this comment.
Just one more comment (considering all of the package.json's)
kurkle
left a comment
There was a problem hiding this comment.
Something about this should be mentioned in https://www.chartjs.org/docs/master/migration/v4-migration.html but I don't want to hold because of that.
|
I will resolve conflicts later today |
|
Should we keep the unminified UMD build? It might help people if they encounter an error in the minified build or otherwise want to debug. Perhaps we should have a |
|
@benmccann maybe just emit sourcemaps for UMD bundle ? |
Alternative of #10479
More changes than expected, but still.
To import CommonJS modules in/from ESM project
.cjsextension is required.