refactor: convert to ESM modules like sass-loader#593
Merged
Conversation
|
46603e6 to
8203660
Compare
- Set "type": "module" in package.json
- Add `exports` field with import/require conditions; build to dist/esm and dist/cjs
- Source uses `import schema from "./options.json" with { type: "json" }`
and `.js`-suffixed relative imports
- Load less via `await import(normalizeImportSpecifier(pkg))`; the babel
CommonJS transform now skips dynamic-import lowering so the CJS dist
keeps native `import()`
- Drop src/cjs.js and test/cjs.test.js (obsolete with dual build)
- Point test getCompiler at dist/cjs/index.js
- Allow ES2025 syntax in eslint
- Convert lint-staged.config.js to ESM
- Remove commitlint entirely: config file, npm script, husky commit-msg
hook, devDependencies, .cspell word, and CI step
8203660 to
ce3ec35
Compare
This file contains hidden or 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
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.
exportsfield with import/require conditionswith { type: "json" }) for the schemaawait import()with file-URL normalization__dirname, top-level imports instead of require)