Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

desktop: use tsup for builds

Abdullah Attaa3e5ae4cf5de
diff --git a/apps/desktop/package.json b/apps/desktop/package.json
index b6cac06e2..b3724c13f 100644
--- a/apps/desktop/package.json
+++ b/apps/desktop/package.json
@@ -6,7 +6,20 @@
"appAppleId": "1544027013",
"private": true,
"main": "./dist/index.js",
+ "module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
+ "exports": {
+ ".": {
+ "require": {
+ "types": "./dist/index.d.ts",
+ "default": "./dist/index.js"
+ },
+ "import": {
+ "types": "./dist/index.d.mts",
+ "default": "./dist/index.mjs"
+ }
+ }
+ },
"homepage": "https://notesnook.com/",
"repository": "https://github.com/streetwriters/notesnook",
"license": "GPL-3.0-or-later",
@@ -44,7 +57,7 @@
"start": "node scripts/dev.mjs",
"staging": "node scripts/build.mjs --run",
"release": "node scripts/build.mjs",
- "build": "tsc",
+ "build": "tsup-node src/index.ts",
"bundle": "esbuild electron=./src/main.ts ./src/preload.ts --external:electron --external:fsevents --external:better-sqlite3-multiple-ciphers --external:sodium-native --minify --bundle --outdir=./build --platform=node --tsconfig=tsconfig.json --define:MAC_APP_STORE=false --define:RELEASE=true",
"bundle:mas": "esbuild electron=./src/main.ts ./src/preload.ts --minify --external:electron --external:fsevents --bundle --outdir=./build --platform=node --tsconfig=tsconfig.json --define:MAC_APP_STORE=true --define:RELEASE=true",
"postinstall": "patch-package"
diff --git a/apps/desktop/src/index.ts b/apps/desktop/src/index.ts
index 4b5e8a7f4..8a582386d 100644
--- a/apps/desktop/src/index.ts
+++ b/apps/desktop/src/index.ts
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-export * from "./constants";
+export { PATHS } from "./constants";
export type { AppRouter } from "./api";
export { type UpdateInfo } from "builder-util-runtime";
export { type DesktopIntegration } from "./utils/config";