-
Notifications
You must be signed in to change notification settings - Fork 25
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
Reduce ambiguity in *.js file extension in addon-root files by explicitly mentioning cjs or mjs #103
Conversation
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.
LGTM
we currently rely on type to not be set at all in package.json
should we change that?
@@ -1,4 +1,4 @@ | |||
<% if (typescript) { %>import typescript from 'rollup-plugin-ts';<% } else { %>import babel from '@rollup/plugin-babel';<% } %> | |||
<% if (typescript) { %>import typescript from 'rollup-plugin-ts';<% } else { %>import { babel } from '@rollup/plugin-babel';<% } %> |
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.
Was this a real bug, or why this change?
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.
even though the package exports both default and named babel, some tooling requires the named export.
I forget now, but I'd rather go with what's stable for all environments, than using default
"just cause".
I should really have written this down when I encountered it :(
I don't think we can -- something to do with ember-auto-import, I think? |
We think type:module support might already be working now due to embroider-build/ember-auto-import#544 |
This is partially w/r/t to linters being able to correctly match based on package.json settings, but partially because we currently rely on
type
to not be set at all in package.json, which implies that.js
is common-js, but that's not always true.For tooling sanity, this PR makes the cjs files .cjs, and the rollup file .mjs
This work came out of CrowdStrike/ember-toucan-core#9
Which, I'd normally say it isn't fair to change things just because of one person's lint configs, but the ambiguity in v2 addons right now is def troublesome