This repository has been archived by the owner on Aug 15, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 30
Convert package to ESM #70
Closed
9 tasks
nzakas opened this issue
May 7, 2021
· 6 comments
· Fixed by #71 · May be fixed by OKEAMAH/remix-project#10
Closed
9 tasks
Convert package to ESM #70
nzakas opened this issue
May 7, 2021
· 6 comments
· Fixed by #71 · May be fixed by OKEAMAH/remix-project#10
Labels
Comments
Would you like to change to named exports here too? |
Sure, I'm open to that. |
FWIW, in my PR I've kept some single item files as default exports, but for the main one (the one being exported) and others, they are named. |
@aladdin-add would it stop them from upgrading, or would they just wait a bit longer? I assume with a breaking change that it would probably go through a more thorough evaluation before upgrading regardless. |
yes, they will drop Node.js < 12 at some point, it's just a bit longer. |
nzakas
added a commit
that referenced
this issue
Jul 22, 2021
* Chore: Update devDeps. * Chore: Lint according to latest config * Breaking: Switch to ESM; also adds eslint-plugin-jsdoc for linter * Fix: Sync with eslint-visitor-keys, including fixing cjs linting * Update package.json Co-authored-by: Nicholas C. Zakas <[email protected]> * Test: Drop Node 13, 10, 8 tests, and add 16, 12.22.0 * Docs: Add comment to explain shelljs command * Refactor: Apply new API and ESM changes * Chore: Update devDeps. * Docs: Update espree usage in README * Test: Add CJS file * Update README.md Co-authored-by: Nicholas C. Zakas <[email protected]> * Fix: Avoid named imports of CJS modules * Fix: For browser compatibility, avoid package.json file-reading attempt * Refactor: Drop `fs` from Rollup now that not in use * Fix: Stop re-exporting Scope child classes and only export `Scope` * Fix: Re-export Reference, Definition, and PatternVisitor * Update Makefile.js Co-authored-by: Milos Djermanovic <[email protected]> * Update tests/commonjs.cjs Co-authored-by: Brandon Mills <[email protected]> Co-authored-by: Nicholas C. Zakas <[email protected]> Co-authored-by: Milos Djermanovic <[email protected]> Co-authored-by: Brandon Mills <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
To convert this package from CommonJS to ECMAScript modules (ESM):
type: module
topackage.json
lib
to ESMtests/lib
to ESMbuild
script inpackage.json
to generate CommonJS file (.cjs
) indist
directory (use Rollup)dist
to.gitignore
build
inprepare
script inpackage.json
to ensure build is run at key momentspackage.json
so thatmain
points in the CJS file indist
andexports
provides bothrequire
andimport
optionsThe text was updated successfully, but these errors were encountered: