acebase-client/create-package-files
2026-04-16 16:11:22 +02:00

37 lines
985 B
Bash

#!/bin/bash
# Create CommonJS package.json
cat >dist/cjs/package.json <<JSON
{
"type": "commonjs",
"browser": {
"socket.io-client": "socket.io-client/dist/socket.io.min.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.esm.min.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