-
Notifications
You must be signed in to change notification settings - Fork 58
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
feat: build esm modules using ipjs #863
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Includes ipjs to build esm projects. - Auto-detects esm projects based on the `"type": "module"` field in the project `package.json` - Builds cjs and esm version of the project with exports/browser/filesystem fallback for maximum compatibility TODO: - [ ] Publishing from `dist` folder - [ ] Bundling? - [ ] TS definitions?
5 tasks
vasco-santos
requested changes
Jul 22, 2021
Comment on lines
+85
to
+89
enabled: async ctx => { | ||
const pkg = await fs.readJSON(path.join(process.cwd(), 'package.json')) | ||
|
||
return pkg.type === 'module' | ||
}, |
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.
Suggested change
enabled: async ctx => { | |
const pkg = await fs.readJSON(path.join(process.cwd(), 'package.json')) | |
return pkg.type === 'module' | |
}, | |
enabled: ctx => { | |
const pkg = fs.readJsonSync(path.join(process.cwd(), 'package.json')) | |
return pkg.type === 'module' | |
}, |
listr
enabled does not allow async functions
Superseded by #865 |
achingbrain
added a commit
that referenced
this pull request
Aug 14, 2021
This builds up on @achingbrain 's work on #863 with build improvements and full support This adds: - `ipjs` for ESM modules - auto-detected - `types` property transformation, allowing real time ts check in dev and path update for dist folder (TLDR no dist in the path) - `release` for ESM modules will navigate to the dist to publish its content - Dockerfile to bundlesize action per actions/runner#772 (comment) as we need node14+ for ESM One of the problematic modules in skypack using aegir is `uint8arrays`. It is a CJS module that depends on a ESM first module (multiformats), which makes skypack to get bad dependency paths. I tested this out shipping `uint8arrays` achingbrain/uint8arrays#22 PR and everything working smoothly 🎉 Original release: https://codepen.io/vascosantos/pen/KKmXoPV?editors=0011 Scoped release using `aegir`: https://codepen.io/vascosantos/pen/bGWoONq?editors=0011 (see browser built in console for errors) Co-authored-by: achingbrain <alex@achingbrain.net>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Includes ipjs to build esm projects.
"type": "module"
field in the projectpackage.json
TODO:
dist
folder