From 46b7acc9bbe7cf52ddf3ed7d7e9399332b463fe5 Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Thu, 25 Apr 2024 11:58:32 -0600 Subject: [PATCH] fix(tsconfig): modify some tsconfig settings to get isolated configs for web/cjs/esm --- bundle.mjs | 6 ++---- tsconfig.cjs.json | 1 - tsconfig.json | 2 +- tsconfig.web.json | 2 ++ 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/bundle.mjs b/bundle.mjs index a2d5f435..eb8798f5 100644 --- a/bundle.mjs +++ b/bundle.mjs @@ -1,9 +1,9 @@ import { build } from 'esbuild'; import { polyfillNode } from 'esbuild-plugin-polyfill-node'; -const bundle = () => { +const bundle = async () => { console.log('Building web bundle esm.'); - const result = build({ + await build({ entryPoints: ['./src/web/index.ts'], bundle: true, platform: 'browser', @@ -30,5 +30,3 @@ const bundle = () => { }; bundle(); - -export { bundle }; diff --git a/tsconfig.cjs.json b/tsconfig.cjs.json index 3c707d50..b6b7e42e 100644 --- a/tsconfig.cjs.json +++ b/tsconfig.cjs.json @@ -1,6 +1,5 @@ { "extends": "./tsconfig.json", - "exclude": ["src/web"], "compilerOptions": { "module": "commonjs", "moduleResolution": "node", diff --git a/tsconfig.json b/tsconfig.json index 4dd6d5f0..1ea1c608 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "esnext", "allowSyntheticDefaultImports": true, - "lib": ["esnext", "dom"], + "lib": ["esnext"], "outDir": "./lib/esm", "listEmittedFiles": false, "listFiles": false, diff --git a/tsconfig.web.json b/tsconfig.web.json index ee047241..a4144a44 100644 --- a/tsconfig.web.json +++ b/tsconfig.web.json @@ -1,8 +1,10 @@ { "extends": "./tsconfig.json", + "lib": ["esnext", "dom"], "include": ["src/web", "src/common", "src/utils"], "compilerOptions": { "outDir": "./lib/web", + "moduleResolution": "bundler", "paths": { "arweave": ["./node_modules/arweave/node/index.js"] }