Skip to content

Commit 193307c

Browse files
authored
ES6 Module Output (#275)
1 parent 5b4a503 commit 193307c

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"name": "use-http",
3-
"version": "1.0.11",
3+
"version": "1.0.12",
44
"homepage": "https://use-http.com",
5-
"main": "dist/index.js",
5+
"main": "dist/cjs/index.js",
6+
"module": "dist/esm/index.js",
67
"license": "MIT",
78
"repository": {
89
"type": "git",
@@ -53,9 +54,11 @@
5354
"watch": "^1.0.2"
5455
},
5556
"scripts": {
56-
"prepublishOnly": "yarn build:production # runs before publish",
57-
"build": "rm -rf dist && tsc --module CommonJS",
57+
"prepublishOnly": "yarn build:production && yarn build:production:esm # runs before publish",
58+
"build": "rm -rf dist/cjs && tsc --module CommonJS --outDir dist/cjs",
59+
"build:esm": "rm -rf dist/esm && tsc",
5860
"build:production": "yarn build -p tsconfig.production.json",
61+
"build:production:esm": "yarn build:esm -p tsconfig.production.json",
5962
"build:watch": "rm -rf dist && tsc -w --module CommonJS",
6063
"tsc": "tsc -p . --noEmit && tsc -p ./src/__tests__",
6164
"test:browser": "yarn tsc && jest -c ./config/jest.config.js --env=jsdom",

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
"moduleResolution": "node",
1717
"noImplicitAny": true,
1818
"noUnusedLocals": true,
19-
"outDir": "dist",
19+
"outDir": "dist/esm",
2020
"sourceMap": true,
2121
"strict": true,
2222
"target": "es5"
2323
},
2424
"include": [
2525
"src/*.ts"
2626
]
27-
}
27+
}

0 commit comments

Comments
 (0)