git » sdk » commit a50c707

Enable optimizer and made sourcemaps

author Stephen Paul Weber
2025-10-29 02:19:46 UTC
committer Stephen Paul Weber
2025-10-29 02:23:51 UTC
parent 3d77d20d84fb64a63fa6dc3cc1713b6d6e4c4d3c

Enable optimizer and made sourcemaps

.gitignore +1 -0
Makefile +2 -2
browserjs.hxml +3 -0
cpp.hxml +2 -0
nodejs.hxml +3 -0

diff --git a/.gitignore b/.gitignore
index 6174b23..737d41f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
 npm/package-lock.json
 npm/*.d.ts
+npm/*.map
 npm/MediaStoreCache.js
 npm/sqlite-worker1.mjs
 npm/IDB.js
diff --git a/Makefile b/Makefile
index d5c70fe..7a1ae3b 100644
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,7 @@ npm/borogove-browser.js:
 	sed -i 's/borogove\.EncryptionMode/enums.EncryptionMode/g' npm/borogove-browser.d.ts
 	sed -i 's/borogove\.EncryptionStatus/enums.EncryptionStatus/g' npm/borogove-browser.d.ts
 	sed -i '1ivar exports = {};' npm/borogove-browser.js
-	echo "export const borogove = exports.borogove;" >> npm/borogove-browser.js
+	sed -i '$$i export const borogove = exports.borogove;' npm/borogove-browser.js
 
 npm/borogove.js:
 	haxe nodejs.hxml
@@ -54,7 +54,7 @@ npm/borogove.js:
 	sed -i '1iimport { createRequire } from "module";' npm/borogove.js
 	sed -i '1iglobal.require = createRequire(import.meta.url);' npm/borogove.js
 	sed -i '1ivar exports = {};' npm/borogove.js
-	echo "export const borogove = exports.borogove;" >> npm/borogove.js
+	sed -i '$$i export const borogove = exports.borogove;' npm/borogove.js
 
 npm: npm/borogove-browser.js npm/borogove.js borogove/persistence/IDB.js borogove/persistence/MediaStoreCache.js borogove/persistence/sqlite-worker1.mjs
 	cp borogove/persistence/IDB.js npm
diff --git a/browserjs.hxml b/browserjs.hxml
index aa664ab..48d3979 100644
--- a/browserjs.hxml
+++ b/browserjs.hxml
@@ -13,7 +13,10 @@ borogove.Push
 borogove.Version
 borogove.persistence.Sqlite
 
+-D analyzer-optimize
 -D js-es=6
+-D source-map
+-D source-map-content
 -D hxtsdgen_enums_ts
 -D hxtsdgen_namespaced
 -D NO_OMEMO
diff --git a/cpp.hxml b/cpp.hxml
index e88bc4d..d398931 100644
--- a/cpp.hxml
+++ b/cpp.hxml
@@ -16,6 +16,8 @@ borogove.persistence.Sqlite
 borogove.persistence.MediaStoreFS
 
 --cpp cpp
+-D analyzer-optimize
+-D annotate-source
 -D NO_OMEMO
 -D HXCPP_ALIGN_ALLOC
 -D HXCPP_CPP17
diff --git a/nodejs.hxml b/nodejs.hxml
index 86f5891..8bc330c 100644
--- a/nodejs.hxml
+++ b/nodejs.hxml
@@ -14,7 +14,10 @@ borogove.Push
 borogove.Version
 borogove.persistence.Sqlite
 
+-D analyzer-optimize
 -D js-es=6
+-D source-map
+-D source-map-content
 -D hxtsdgen_enums_ts
 -D hxtsdgen_namespaced
 -D NO_OMEMO