Skip to content

Commit

Permalink
add esm build with index.mjs output
Browse files Browse the repository at this point in the history
add esm build with `index.mjs` output to fix #7

place builds and type defs in `lib` directory

update changelog and version
  • Loading branch information
thekelvinliu committed May 24, 2021
1 parent b540e18 commit 38faa2b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ all notable changes to this project will be documented in this file.
the format is based on [keep a changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [semantic versioning](https://semver.org/spec/v2.0.0.html).

## [2.3.0] - 2021-05-23

### added

- esm build with `.mjs` extension for official nodejs esm import support

## [2.2.0] - 2020-12-30

### added
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
{
"name": "country-code-emoji",
"version": "2.2.0",
"version": "2.3.0",
"description": "convert country codes (ISO 3166-1 alpha-2) to corresponding emoji flags (unicode regional indicator symbols)",
"main": "lib/index.js",
"repository": "github:thekelvinliu/country-code-emoji",
"author": "kelvin liu <[email protected]>",
"license": "MIT",
"module": "src/index.js",
"types": "types/index.d.ts",
"types": "lib/index.d.ts",
"exports": {
"import": "./src/index.js",
"import": "./lib/index.mjs",
"require": "./lib/index.js"
},
"homepage": "https://github.com/thekelvinliu/country-code-emoji#readme",
"bugs": {
"url": "https://github.com/thekelvinliu/country-code-emoji/issues"
},
"scripts": {
"build": "esbuild src/index.js --format=cjs --outdir=lib --target=node10",
"clean": "rm -rf coverage lib types",
"build": "yarn build:cjs && yarn build:esm",
"build:cjs": "esbuild src/index.js --format=cjs --outdir=lib --target=node12",
"build:esm": "esbuild src/index.js --format=esm --outfile=lib/index.mjs --target=node12",
"clean": "rm -rf coverage lib",
"lint": "eslint .",
"prepublishOnly": "yarn build && yarn types",
"reset": "rm -rf node_modules package-lock.json yarn.lock",
Expand All @@ -41,8 +43,7 @@
},
"files": [
"lib",
"src",
"types"
"src"
],
"keywords": [
"country",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"allowJs": true,
"declaration": true,
"emitDeclarationOnly": true,
"outDir": "types"
"outDir": "lib"
},
"include": ["src/index.js"]
}

0 comments on commit 38faa2b

Please sign in to comment.