Skip to content

Commit 2f11fe8

Browse files
authored
adjust package build (#86)
1 parent b807766 commit 2f11fe8

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.idea
2-
build/
32
cjs/
3+
esm/
44
coverage/
55
node_modules/
66
package-lock.json

package.json

+11-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
{
22
"name": "nflx-spectator",
3-
"version": "3.0.0-rc.3",
3+
"version": "3.0.0-rc.4",
44
"license": "Apache-2.0",
55
"homepage": "https://github.com/Netflix/spectator-js",
66
"author": "Netflix Telemetry Engineering <[email protected]>",
77
"type": "module",
88
"main": "cjs/src/index.js",
9-
"module": "build/src/index.js",
109
"types": "build/src/index.d.ts",
10+
"exports": {
11+
"import": "./esm/src/index.js",
12+
"require": "./cjs/src/index.js"
13+
},
1114
"files": [
12-
"build/src/**/*",
15+
"esm/src/**/*",
1316
"cjs/src/**/*.js"
1417
],
1518
"engines": {
@@ -32,12 +35,12 @@
3235
"typescript": "^5.8.2"
3336
},
3437
"scripts": {
35-
"clean": "rm -rf build cjs",
36-
"build": "tsc; tsc --outDir cjs --module commonjs",
38+
"clean": "rm -rf cjs coverage esm",
39+
"build": "tsc --module commonjs --outDir cjs; tsc --module es2022 --outDir esm",
3740
"build-and-test": "npm run build; npm run test",
3841
"lint": "eslint 'src/**/*.ts' 'test/**/*.ts'",
39-
"test": "mocha 'build/test/**/*.test.js'",
40-
"test-with-coverage": "c8 mocha --reporter min 'build/test/**/*.test.js'",
41-
"check-coverage": "c8 check-coverage --lines 90 mocha 'build/test/**/*.test.js'"
42+
"test": "mocha 'esm/test/**/*.test.js'",
43+
"test-with-coverage": "c8 mocha --reporter min 'esm/test/**/*.test.js'",
44+
"check-coverage": "c8 check-coverage --lines 90 mocha 'esm/test/**/*.test.js'"
4245
}
4346
}

tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/* Visit https://aka.ms/tsconfig to read more about this file */
44

55
/* Language and Environment */
6-
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
6+
"target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
77

88
/* Modules */
99
"module": "nodenext", /* Specify what module code is generated. */

0 commit comments

Comments
 (0)