Files
Unify/framework/npmScripts/esbuild/esbuild.android.js
2025-12-25 11:16:59 +01:00

34 lines
971 B
JavaScript

/*
Copyright (c) 2020, 2023, The Unified Company.
This code is part of Unify.
This program is free software; you can redistribute it and/or modify
it under the terms of the ESA Software Community License - Strong Copyleft,
https://unifyjs.org
*/
import esbuild from "../../node_modules/esbuild/node_modules/esbuild/lib/main.js";
import fse from "fs-extra";
esbuild.build({
bundle: true,
entryPoints: ["./framework/server/index.js"],
outfile: "./platforms/android/projectRoot/framework/server/index.js",
platform: "node",
target: "node12",
keepNames: true,
external: ["../node_modules/better-sqlite3/node_modules/better-sqlite3/lib/index.js" ]
});
var uniqueName = Math.floor(Math.random() * 10000000000);
fse.copySync("./assets/bundle.js", "./platforms/android/projectRoot/assets/bundle-" +uniqueName+ ".js");
fse.writeFileSync( "./platforms/android/projectRoot/assets/bundleName.json", JSON.stringify( { uniqueName : uniqueName } ) );