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
Convert package to ESM #70
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. |
* 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 <nicholas@humanwhocodes.com> * 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 <nicholas@humanwhocodes.com> * 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 <milos.djermanovic@gmail.com> * Update tests/commonjs.cjs Co-authored-by: Brandon Mills <btmills@users.noreply.github.com> Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com> Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com> Co-authored-by: Brandon Mills <btmills@users.noreply.github.com>
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: