First commit
This commit is contained in:
33
framework/npmScripts/esbuild/esbuild.android.js
Normal file
33
framework/npmScripts/esbuild/esbuild.android.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
|
||||
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 } ) );
|
||||
|
||||
34
framework/npmScripts/esbuild/esbuild.client.js
Normal file
34
framework/npmScripts/esbuild/esbuild.client.js
Normal file
@@ -0,0 +1,34 @@
|
||||
|
||||
|
||||
import binaryName from "../../node_modules/esbuild/getBinaryName.js"
|
||||
|
||||
|
||||
|
||||
import child_process from 'child_process';
|
||||
|
||||
var options = new Object();
|
||||
|
||||
options.stdio = 'inherit';
|
||||
|
||||
var args = new Array();
|
||||
|
||||
|
||||
|
||||
args.push("--bundle")
|
||||
|
||||
args.push('out1=framework/client/index.js')
|
||||
|
||||
args.push("--outfile=assets/bundle.js")
|
||||
|
||||
args.push("--keep-names")
|
||||
|
||||
args.push('--external:fs, better-sqlite3, process')
|
||||
|
||||
args.push('--format=esm')
|
||||
|
||||
|
||||
|
||||
var child = child_process.spawn( binaryName, args, options );
|
||||
|
||||
|
||||
console.log(binaryName);
|
||||
22
framework/npmScripts/esbuild/esbuild.concurrently.js
Normal file
22
framework/npmScripts/esbuild/esbuild.concurrently.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
|
||||
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 "esbuild";
|
||||
|
||||
esbuild.buildSync({
|
||||
bundle: true,
|
||||
entryPoints: ["node_modules/concurrently/dist/bin/concurrently.js"],
|
||||
outfile: "concurrently_bundle.js",
|
||||
keepNames: true,
|
||||
target: ['node16.7']
|
||||
});
|
||||
35
framework/npmScripts/esbuild/esbuild.hybrid.js
Normal file
35
framework/npmScripts/esbuild/esbuild.hybrid.js
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
|
||||
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/hybrid/framework/server/index.js",
|
||||
platform: "node",
|
||||
target: "node12",
|
||||
keepNames: true,
|
||||
external: [ ]
|
||||
});
|
||||
|
||||
fse.copySync("./framework/configs", "./platforms/hybrid/framework/configs");
|
||||
|
||||
fse.copySync("./assets/bundle.js", "./platforms/hybrid/assets/bundle.js");
|
||||
|
||||
fse.copySync("framework/node_modules/better-sqlite3/node_modules/better-sqlite3/build/Release/", "./platforms/hybrid/build/");
|
||||
|
||||
fse.copySync("./assets/production", "./platforms/hybrid/assets/production");
|
||||
32
framework/npmScripts/esbuild/esbuild.native.js
Normal file
32
framework/npmScripts/esbuild/esbuild.native.js
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
|
||||
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: "./native/framework/server/index.js",
|
||||
platform: "node",
|
||||
target: "node12",
|
||||
keepNames: true,
|
||||
external: [ ]
|
||||
});
|
||||
|
||||
|
||||
fse.copySync("./assets/bundle.js", "./native/assets/bundle.js");
|
||||
|
||||
fse.copySync("framework/node_modules/better-sqlite3/node_modules/better-sqlite3/build/Release/", "./native/build/");
|
||||
Reference in New Issue
Block a user