Skip to content

Explicitly define exports for npm package, closes #134#163

Closed
RVledder wants to merge 2 commits intomicrosoft:mainfrom
RVledder:fix/gh-134-export-pattern
Closed

Explicitly define exports for npm package, closes #134#163
RVledder wants to merge 2 commits intomicrosoft:mainfrom
RVledder:fix/gh-134-export-pattern

Conversation

@RVledder
Copy link

@RVledder RVledder commented Nov 24, 2021

Tried it out in a local project and it works. But that's a specific implementation. Also, the tests are green.

Would be interested in any thoughts of a repository maintainer. More info in #134

remivledder added 2 commits November 24, 2021 14:07
Signed-off-by: remivledder <remi.vledder@powerhouse.nl>
Signed-off-by: remivledder <remi.vledder@powerhouse.nl>
@RVledder
Copy link
Author

RVledder commented Nov 24, 2021

Using the test script by @rbuckton in this comment:

Version (a) (b) (c) (d)
17.0.0 ESM CommonJS Warning ³, SyntaxError ¹ TypeError ²
15.4.0 ESM CommonJS Warning ³, SyntaxError ¹ TypeError ²
12.20.1 ESM CommonJS Warning ³, SyntaxError ¹ TypeError ²
12.18.3 ESM CommonJS SyntaxError ¹ TypeError ²
12.7.0* CommonJS CommonJS SyntaxError ¹ ok
12.7.0 Error [ERR_REQUIRE_ESM]

NOTES:
* with --experimental-modules ON
¹ SyntaxError Unexpected token export - Loader tried to load ESM module as CommonJS
² TypeError Unknown file extension ".json" - Loader won't load .json
³ Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.

@prescience-data
Copy link

Hopefully this works!
🙏🏻

@RVledder
Copy link
Author

So... Is this library still maintained?

@georgebrindeiro
Copy link

@rbuckton @DanielRosenwasser @orta could you give us a hand getting this merged? Maybe point us in the right direction of who could/should review and approve it?

@rbuckton
Copy link
Contributor

rbuckton commented Feb 8, 2022

I merged #135, so this is no longer needed.

@rbuckton rbuckton closed this Feb 8, 2022
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.

4 participants