-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcreate-package-files
37 lines (33 loc) · 983 Bytes
/
create-package-files
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# Create CommonJS package.json
cat >dist/cjs/package.json <<JSON
{
"type": "commonjs",
"browser": {
"socket.io-client": "socket.io-client/dist/socket.io.slim.js",
"./request/index.js": "./request/browser.js",
"./performance/index.js": "./performance/browser.js",
"./base64/index.js": "./base64/browser.js"
}
}
JSON
# Write typings to support Node16 module resolution
cat >dist/cjs/index.d.ts <<TYPESCRIPT
export * from '../types';
TYPESCRIPT
# Create ESM package.json
cat >dist/esm/package.json <<JSON
{
"type": "module",
"browser": {
"socket.io-client": "socket.io-client/dist/socket.io.slim.js",
"./request/index.js": "./request/browser.js",
"./performance/index.js": "./performance/browser.js",
"./base64/index.js": "./base64/browser.js"
}
}
JSON
# Write typings to support Node16 module resolution
cat >dist/esm/index.d.ts <<TYPESCRIPT
export * from '../types';
TYPESCRIPT