File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 2424}
2525```
2626
27+
28+ > source: [ https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/ ] ( https://devblogs.microsoft.com/typescript/announcing-typescript-4-5-beta/ )
29+
30+ ``` json
31+ // package.json
32+ {
33+ "name" : " my-package" ,
34+ "type" : " module" ,
35+ "exports" : {
36+ "." : {
37+ // Entry-point for `import "my-package"` in ESM
38+ "import" : " ./esm/index.js" ,
39+
40+ // Entry-point for `require("my-package") in CJS
41+ "require" : " ./commonjs/index.cjs" ,
42+
43+ // Entry-point for TypeScript resolution
44+ "types" : " ./types/index.d.ts"
45+ },
46+ },
47+
48+ // CJS fall-back for older versions of Node.js
49+ "main" : " ./commonjs/index.cjs" ,
50+
51+ // Fall-back for older versions of TypeScript
52+ "types" : " ./types/index.d.ts"
53+ }
54+ ```
55+
56+ ``` json
57+ {
58+ "dependencies" : {
59+ "@typescript/lib-dom" : " npm:@types/web"
60+ }
61+ }
62+ ```
63+
2764## types
2865
2966
You can’t perform that action at this time.
0 commit comments