Skip to content

Commit

Permalink
support esm
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Sep 1, 2023
1 parent a4f8e6a commit acb04f6
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "JavaScript client SDK for bidirectional communication with Centrifugo and Centrifuge-based server from browser, NodeJS and React Native",
"main": "build/index.js",
"types": "build/index.d.ts",
"module": "build/esm/index.js",
"files": [
"dist/**",
"build/**"
Expand All @@ -18,8 +19,10 @@
"clean": "rm -rf dist build package",
"ts-node": "ts-node",
"docs": "typedoc --exclude '**/transport_*.ts' --exclude '**/*.test.ts' --exclude '**/*+(utils|json|codes|browser).ts' --excludePrivate --excludeInternal --entryPoints src/*.ts",
"build": "tsc -p tsconfig.json",
"build-all": "yarn clean && yarn build && yarn build-browser && yarn build-browser-protobuf",
"build:cjs": "tsc -p tsconfig.cjs.json",
"build:esm": "tsc -p tsconfig.esm.json",
"build": "yarn build:cjs && yarn build:esm",
"build-all": "yarn clean && yarn build:cjs && yarn build:esm && yarn build-browser && yarn build-browser-protobuf",
"build-browser": "esbuild src/browser.ts --bundle --minify --sourcemap --outfile=dist/centrifuge.js",
"dev": "esbuild src/browser.ts --bundle --outfile=dist/centrifuge.js --servedir=dist/ --serve=2000",
"build-browser-protobuf": "esbuild src/protobuf/browser.ts --bundle --minify --sourcemap --outfile=dist/centrifuge.protobuf.js",
Expand Down
File renamed without changes.
42 changes: 42 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"compilerOptions": {
"target": "es6",
"module": "ESNext",
"moduleResolution": "node",
"declaration": true,
"strict": true,
"noImplicitAny": false /* Raise error on expressions and declarations with an implied 'any' type. */,
"strictNullChecks": true /* Enable strict null checks. */,
"strictFunctionTypes": true /* Enable strict checking of function types. */,
"noUnusedLocals": true /* Report errors on unused locals. */,
"noUnusedParameters": true /* Report errors on unused parameters. */,
"noImplicitReturns": true /* Report error when not all code paths in function return a value. */,
"noFallthroughCasesInSwitch": true /* Report errors for fallthrough cases in switch statement. */,
"importHelpers": false, /* https://github.com/centrifugal/centrifuge-js/issues/193 */
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"resolveJsonModule": true,
"sourceMap": true,
"stripInternal": true,
"outDir": "./build/esm",
"types": [
"node",
"jest"
],
"lib": [
"ES6",
"DOM"
]
},
"include": [
"src/**/*.ts",
"src/**/*.json"
],
"exclude": [
"node_modules",
"**/*.test.ts",
"**/browser.ts"
]
}

0 comments on commit acb04f6

Please sign in to comment.