Skip to content
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

fix #230 : CJS / ESM conflict #220

Merged
merged 2 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
{
"name": "svelte-i18n",
"version": "3.7.4",
"main": "dist/runtime.cjs.js",
"module": "dist/runtime.esm.js",
"type": "module",
"main": "dist/runtime.js",
"exports": {
"types": "./dist/runtime.d.ts",
"import": "./dist/runtime.js",
"require": "./dist/runtime.cjs"
Comment on lines +8 to +9

Choose a reason for hiding this comment

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

I'd personally make it just:

Suggested change
"import": "./dist/runtime.js",
"require": "./dist/runtime.cjs"
"default": "./dist/runtime.js"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes and it would work also just adding the "default": "./dist/runtime.js" line because it is just a fallback. All this stuff is documented here.

I personally do not need of cjs so I do not care on if this package is a "Dual CommonJS/ES module package" or just esm.

@kaisermann will split this PR and then he will decide on keeping or not the cjs.

Copy link
Owner

Choose a reason for hiding this comment

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

I think we can be esm-only from v4 onwards, assuming 3.7.5 will be working as expected.

},
"types": "dist/runtime.d.ts",
"bin": {
"svelte-i18n": "dist/cli.js"
Expand Down Expand Up @@ -92,7 +97,7 @@
"deepmerge": "^4.2.2",
"esbuild": "^0.19.2",
"estree-walker": "^2",
"intl-messageformat": "^9.13.0",
"intl-messageformat": "^10.5.3",
"sade": "^1.8.1",
"tiny-glob": "^0.2.9"
}
Expand Down
Loading
Loading