Skip to content

Commit

Permalink
🔧 add support to NodeJS ESM
Browse files Browse the repository at this point in the history
  • Loading branch information
VitorLuizC committed Feb 24, 2022
1 parent 557fcbc commit 2cbb3ec
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Provides a simple API to normalize texts, white-spaces, names, paragraphs & diacritics (accents).

- 📦 Distributions in ESM, CommonJS, UMD and UMD _minified_ formats.
- Supports NodeJS ESM and CommonJS;

- ⚡ Lightweight:
- It's bundled with [Rollup](https://rollupjs.org/) and [Bublé](https://buble.surge.sh/).
Expand Down
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
"module": "dist/index.esm.js",
"jsdelivr": "dist/index.umd.min.js",
"umd:main": "dist/index.umd.js",
"exports": {
".": [
{
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
},
"./dist/index.js"
]
},
"scripts": {
"test": "yarn run test:lint && yarn run test:transpile && yarn run test:unit",
"test:transpile": "tsc --project ./tsconfig.test.json",
Expand Down
8 changes: 8 additions & 0 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@ const options = [
format: 'esm',
file: './dist/index.esm.js',
}),
getOutputOption({
format: 'commonjs',
file: './dist/index.cjs',
}),
getOutputOption({
format: 'esm',
file: './dist/index.mjs',
}),
],
},
{
Expand Down

0 comments on commit 2cbb3ec

Please sign in to comment.