Skip to content

Commit

Permalink
fix: Hybrid ESM/CJS format (#128)
Browse files Browse the repository at this point in the history
* Rebuld hybrid package dist for cjs/mjs

* Update README
  • Loading branch information
dmythro authored Oct 20, 2023
1 parent 391cf8b commit d92daf3
Show file tree
Hide file tree
Showing 21 changed files with 320 additions and 284 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ Built files are in the `dist` directory of this repository, and `packages/countr

**Note**: JS build contains ES modules, CommonJS and IIFE (for now)

- CJS `index.min.js`.
- ESM `index.min.mjs`.
- IIFE `index.iife.min.js`.
- CJS `cjs/index.js`
- ESM `mjs/index.js`
- IIFE `index.iife.js`

## Data structure examples

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "annexare/countries-list",
"version": "3.0.5",
"version": "3.0.6",
"description": "Continents & countries: ISO 3166-1 alpha-2 code, name, ISO 639-1 languages, capital, currency, native name, phone. JSON, CSV and SQL.",
"type": "library",
"keywords": [
Expand Down
2 changes: 2 additions & 0 deletions dist/cjs/index.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions dist/cjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"main": "index.js",
"type": "commonjs",
"types": "../index.d.ts"
}
2 changes: 2 additions & 0 deletions dist/index.iife.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/index.iife.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions dist/index.min.js

This file was deleted.

2 changes: 0 additions & 2 deletions dist/index.min.mjs

This file was deleted.

2 changes: 2 additions & 0 deletions dist/mjs/index.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions dist/mjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"main": "index.js",
"type": "module",
"types": "../index.d.ts"
}
12 changes: 6 additions & 6 deletions dist/package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"name": "countries-list",
"version": "3.0.5",
"version": "3.0.6",
"description": "Continents & countries: ISO 3166-1 alpha-2 code, name, ISO 639-1 languages, capital, currency, native name, phone. JSON, CSV and SQL.",
"type": "module",
"main": "index.min.mjs",
"main": "cjs/index.js",
"module": "mjs/index.js",
"exports": {
"./minimal/*": "./minimal/*",
".": {
"require": {
"types": "./index.d.ts",
"default": "./index.min.js"
"default": "./cjs/index.js"
},
"import": {
"types": "./index.d.ts",
"default": "./index.min.mjs"
"default": "./mjs/index.js"
}
}
},
"sideEffects": [
"index.iife.min.js"
"index.iife.js"
],
"types": "index.d.ts",
"repository": {
Expand Down
Loading

0 comments on commit d92daf3

Please sign in to comment.