-
Notifications
You must be signed in to change notification settings - Fork 3
[2.1.x] Migrate from CommonJS (CJS) to ECMAScript Modules (ESM) #37
Copy link
Copy link
Open
Description
We need to transition our codebase from CommonJS (CJS) to ECMAScript Modules (ESM) to align with modern JavaScript standards, improve compatibility with the latest Node.js versions, and enable better tree-shaking for optimized builds.
- Update package.json to "type": "module" (or adjust file extensions accordingly).
- Refactor all require statements to import syntax.
- Update module.exports to export syntax.
- Identify and resolve any dependencies that don’t support ESM.
- Update build and testing configurations if necessary.
- Verify that all scripts and tools (e.g., bundlers, linters) work correctly with ESM.
Additional Context
- If we need dual support (CJS + ESM), we may consider using "exports" field in package.json.
- Some dependencies may still require dynamic imports (import() instead of require).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels