Skip to content

Use commonjs syntax for exports#63

Open
chriddell wants to merge 1 commit into
mainfrom
task/use-commonjs-export
Open

Use commonjs syntax for exports#63
chriddell wants to merge 1 commit into
mainfrom
task/use-commonjs-export

Conversation

@chriddell
Copy link
Copy Markdown
Member

What does this change?

Use the module.exports (commonjs) syntax instead of export (ESM) syntax. This prevents confusion when importing the package in projects using older versions of Node which don't natively support ESM.

e.g.

image

How to test

You could use npm link to link the package locally, and make sure it still works in your project. I've done this, and it does!

https://dev.to/erinbush/npm-linking-and-unlinking-2h1g

How can we measure success?

Have we considered potential risks?

@chriddell chriddell requested a review from Copilot October 1, 2025 10:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR converts the theme module from ES Module (ESM) export syntax to CommonJS export syntax to improve compatibility with older Node.js versions that don't natively support ESM imports.

  • Changed from export const theme = {...} to module.exports = { theme: {...} }
  • Wrapped the existing theme object as a property of the exported object
  • Added proper closing brace to maintain the nested structure

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread theme.js
@rcantin-w rcantin-w requested review from davidpmccormick and removed request for rcantin-w October 22, 2025 15:29
Copy link
Copy Markdown
Contributor

@stuartwilkes stuartwilkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@davidpmccormick davidpmccormick removed their request for review February 26, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants