From 7fa40b587209025d89776e7ffbb85dae9b6f5e29 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Tue, 19 Sep 2023 03:09:44 +0530 Subject: [PATCH] fix: building for web target --- .swcrc | 8 ++++++++ package.json | 4 ++-- spack.config.js | 8 ++++++++ src/index.ts | 1 - 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 .swcrc create mode 100644 spack.config.js diff --git a/.swcrc b/.swcrc new file mode 100644 index 0000000..748234d --- /dev/null +++ b/.swcrc @@ -0,0 +1,8 @@ +{ + "jsc": { + "parser": { + "syntax": "typescript", + "tsx": false + } + } +} diff --git a/package.json b/package.json index 2bba396..a3c19c5 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,10 @@ "description": "", "main": "index.js", "scripts": { - "build": "swc ./src/index.ts -o dist/index.js", + "build": "spack", "lint": "prettier --write ./src/*", "test": "jest", - "doc": "typedoc ./src/index.ts ./src/auth.ts ./src/spec/**" + "doc": "typedoc ./src/index.ts" }, "keywords": [], "author": "", diff --git a/spack.config.js b/spack.config.js new file mode 100644 index 0000000..78d7f5e --- /dev/null +++ b/spack.config.js @@ -0,0 +1,8 @@ +module.exports = { + entry: { + web: __dirname + "/src/index.ts", + }, + output: { + path: __dirname + "/dist", + }, +}; diff --git a/src/index.ts b/src/index.ts index 8c9ee0e..d2307d1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -241,4 +241,3 @@ class Forgejo { } export default Forgejo; -export { Repository, Notification, User, Comment, Issue, Auth };