Skip to content

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

desktop: fix `Unexpected token 'with'` on build

Abdullah Atta8ffb49b70018
diff --git a/apps/desktop/scripts/build.mjs b/apps/desktop/scripts/build.mjs
index c62b8c593..9388258f7 100644
--- a/apps/desktop/scripts/build.mjs
+++ b/apps/desktop/scripts/build.mjs
@@ -19,16 +19,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
import path from "path";
import fs, { readFile, writeFile } from "fs/promises";
-import { existsSync } from "fs";
+import { existsSync, readFileSync } from "fs";
import yargs from "yargs-parser";
import os from "os";
import * as childProcess from "child_process";
import { fileURLToPath } from "url";
-import packageJson from "../package.json" with {type: "json"};
const args = yargs(process.argv);
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
+const packageJson = JSON.parse(
+ readFileSync(path.join(__dirname, "..", "package.json"), "utf-8")
+);
const webAppPath = path.resolve(path.join(__dirname, "..", "..", "web"));