Skip to content

Commit d950c8d

Browse files
[pkg] Package as esm
1 parent 07e8e82 commit d950c8d

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
node_modules
22
coverage
3+
dist

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@
33
"version": "1.0.0",
44
"description": "Check if a protocol requires a certain port number to be added to an URL.",
55
"main": "index.js",
6+
"module": "./dist/index.mjs",
67
"scripts": {
78
"test": "c8 --reporter=lcov --reporter=text mocha test.js",
8-
"watch": "mocha --watch test.js"
9+
"build-esm": "esbuild index.js --outfile=dist/index.mjs --format=esm",
10+
"watch": "mocha --watch test.js",
11+
"prepublishOnly": "npm run build-esm"
912
},
1013
"repository": {
1114
"type": "git",
@@ -38,6 +41,7 @@
3841
"devDependencies": {
3942
"assume": "~2.3.0",
4043
"c8": "~7.12.0",
44+
"esbuild": "^0.17.18",
4145
"mocha": "~10.2.0",
4246
"pre-commit": "~1.2.0"
4347
}

0 commit comments

Comments
 (0)