File tree Expand file tree Collapse file tree 6 files changed +40
-4
lines changed
Expand file tree Collapse file tree 6 files changed +40
-4
lines changed Original file line number Diff line number Diff line change 1010 " ../src/**/*.mts" ,
1111 " ../src/package.json" ,
1212 " ../src/diagnostics-channel-esm.mts" ,
13- " ../src/diagnostics-channel-node.mts"
13+ " ../src/diagnostics-channel-node.mts" ,
14+ " ../src/diagnostics-channel-browser.mts"
1415 ],
1516 "compilerOptions" : {
1617 "outDir" : " ../.tshy-build/commonjs"
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ./build.json" ,
3+ "include" : [
4+ " ../src/**/*.ts" ,
5+ " ../src/**/*.mts" ,
6+ " ../src/**/*.tsx" ,
7+ " ../src/**/*.json"
8+ ],
9+ "exclude" : [
10+ " ../src/package.json" ,
11+ " ../src/diagnostics-channel-esm.mts" ,
12+ " ../src/diagnostics-channel-node.mts"
13+ ],
14+ "compilerOptions" : {
15+ "outDir" : " ../.tshy-build/esm/browser"
16+ }
17+ }
Original file line number Diff line number Diff line change 88 ],
99 "exclude" : [
1010 " ../src/package.json" ,
11- " ../src/diagnostics-channel-esm.mts"
11+ " ../src/diagnostics-channel-esm.mts" ,
12+ " ../src/diagnostics-channel-browser.mts"
1213 ],
1314 "compilerOptions" : {
1415 "outDir" : " ../.tshy-build/esm/node"
Original file line number Diff line number Diff line change 88 ],
99 "exclude" : [
1010 " ../src/package.json" ,
11- " ../src/diagnostics-channel-node.mts"
11+ " ../src/diagnostics-channel-node.mts" ,
12+ " ../src/diagnostics-channel-browser.mts"
1213 ],
1314 "compilerOptions" : {
1415 "outDir" : " ../.tshy-build/esm"
Original file line number Diff line number Diff line change 3434 "types" : " ./dist/commonjs/index.d.ts" ,
3535 "tshy" : {
3636 "esmDialects" : [
37- " node"
37+ " node" ,
38+ " browser"
3839 ],
3940 "exports" : {
4041 "./raw" : " ./src/index.ts" ,
8586 "types" : " ./dist/esm/node/index.d.ts" ,
8687 "default" : " ./dist/esm/node/index.js"
8788 },
89+ "browser" : {
90+ "types" : " ./dist/esm/browser/index.d.ts" ,
91+ "default" : " ./dist/esm/browser/index.js"
92+ },
8893 "types" : " ./dist/esm/index.d.ts" ,
8994 "default" : " ./dist/esm/index.js"
9095 },
Original file line number Diff line number Diff line change 1+ // this is used in ESM environments that follow the 'browser' import
2+ // condition, to avoid even trying to load node:diagnostics_channel
3+ import {
4+ type Channel ,
5+ type TracingChannel ,
6+ } from 'node:diagnostics_channel'
7+ export type { TracingChannel , Channel }
8+
9+ const dummy = { hasSubscribers : false }
10+ export const metrics = dummy as Channel < unknown >
11+ export const tracing = dummy as TracingChannel < unknown >
You can’t perform that action at this time.
0 commit comments