From 1df581ffe617fdae8cb96d4fa8e5cb61ad2a4c65 Mon Sep 17 00:00:00 2001 From: KPal <48248865+kpal81xd@users.noreply.github.com> Date: Fri, 24 May 2024 15:54:53 +0100 Subject: [PATCH] Exports and types fixes v1 (#6624) * cleaned up ts and js config; adds debug and profiler to exports * set module resolution to node --- examples/jsconfig.json | 19 +++++++------------ package.json | 13 ++++++++++++- tsconfig.json | 6 +++--- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/examples/jsconfig.json b/examples/jsconfig.json index 2d8dfb699d3..de901df92ec 100644 --- a/examples/jsconfig.json +++ b/examples/jsconfig.json @@ -1,20 +1,15 @@ { "compilerOptions": { - "checkJs": true, - "outDir": "dist", - "noImplicitAny": true, - "strictNullChecks": true, - "module": "esnext", - "target": "es2020", "allowJs": true, - "jsx": "react", - "lib": [ - "es2019", - "dom" - ], "allowSyntheticDefaultImports" : true, + "checkJs": true, "esModuleInterop" : true, - "moduleResolution" : "node" + "module": "es6", + "moduleResolution": "node", + "noImplicitAny": true, + "outDir": "dist", + "strictNullChecks": true, + "target": "es6", }, "include": ["src", "scripts", "iframe", "utils"], "exclude": ["node_modules", "src/lib"] diff --git a/package.json b/package.json index a8cccab5674..53173372b66 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,18 @@ "import": "./build/playcanvas/src/index.js", "require": "./build/playcanvas.js" }, - "./build/*": "./build/*" + "./debug": { + "types": "./build/playcanvas.d.ts", + "import": "./build/playcanvas.dbg/src/index.js", + "require": "./build/playcanvas.dbg.js" + }, + "./profiler": { + "types": "./build/playcanvas.d.ts", + "import": "./build/playcanvas.prf/src/index.js", + "require": "./build/playcanvas.prf.js" + }, + "./build/*": "./build/*", + "./scripts/*": "./scripts/*" }, "sideEffects": false, "type": "module", diff --git a/tsconfig.json b/tsconfig.json index 1c42a1a9f81..93aa0128c48 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,17 @@ { "compilerOptions": { - "baseUrl": ".", - "outDir": "types", "allowJs": true, + "baseUrl": ".", "checkJs": true, "module": "es6", - "target": "es6", "moduleResolution": "node", "noImplicitReturns": true, "noImplicitThis": true, "noUnusedLocals": true, + "outDir": "types", "strictNullChecks": true, "strictPropertyInitialization": true, + "target": "es6", "typeRoots": [ "./node_modules/@webgpu/types", "./node_modules/@types" ] }, "typedocOptions": {