From da4145c855153212e0f524f8913b51848637a6d4 Mon Sep 17 00:00:00 2001 From: Carson McManus Date: Thu, 22 Feb 2024 15:13:41 -0500 Subject: [PATCH] configure ott-common to export the correct files in the right environment --- common/package.json | 15 ++++++++++++++- server/package.json | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/common/package.json b/common/package.json index fd7b64fe0..a88012b65 100644 --- a/common/package.json +++ b/common/package.json @@ -2,8 +2,21 @@ "name": "ott-common", "version": "0.10.0", "license": "AGPL-3.0-or-later", - "module": "es2020", "type": "module", + "module": "index.ts", + "files": [ + "*" + ], + "exports": { + ".": { + "lean": "./ts-out/index.js", + "default": "./index.ts" + }, + "./*": { + "lean": "./ts-out/*", + "default": "./*" + } + }, "scripts": { "build": "tsc", "lint": "tsc --noEmit && eslint --ext .js,.ts --fix .", diff --git a/server/package.json b/server/package.json index c092066bb..88edd6c9b 100644 --- a/server/package.json +++ b/server/package.json @@ -6,7 +6,7 @@ "module": "esnext", "scripts": { "start": "node --experimental-specifier-resolution=node --loader ts-node/esm app.ts", - "start-lean": "node --experimental-specifier-resolution=node --optimize-for-size --max-old-space-size=200 ts-out/server/app.js", + "start-lean": "node --experimental-specifier-resolution=node --optimize-for-size --max-old-space-size=200 --conditions=lean ts-out/app.js", "debug": "nodemon --exec node --experimental-specifier-resolution=node --loader ts-node/esm --ignore 'tests/*' --inspect -e ts,js app.ts", "build": "tsc", "lint": "tsc --noEmit && eslint --fix .",