mirror of
https://github.com/hensm/fx_cast.git
synced 2026-06-11 01:59:58 +00:00
Re-write app build, created macOS installer package
This commit is contained in:
24
ext/build.js
24
ext/build.js
@@ -1,11 +1,19 @@
|
||||
const { spawn } = require('child_process');
|
||||
const argv = require('minimist')(process.argv.slice(2));
|
||||
const fs = require("fs-extra");
|
||||
const path = require("path");
|
||||
const { spawn } = require("child_process");
|
||||
const argv = require("minimist")(process.argv.slice(2));
|
||||
|
||||
|
||||
const extensionName = "fx_cast";
|
||||
const extensionId = "fx_cast@matt.tf";
|
||||
const extensionVersion = "0.0.1";
|
||||
|
||||
|
||||
if (argv.package) {
|
||||
argv.mode = "production";
|
||||
argv.watch = false;
|
||||
}
|
||||
|
||||
// Default argument values
|
||||
const { mirroringAppId = "19A6F4AE"
|
||||
, mode = "development" } = argv;
|
||||
@@ -18,12 +26,16 @@ const child = spawn(
|
||||
+ `--mode=${mode} `
|
||||
+ `${argv.watch ? "--watch" : ""} `
|
||||
+ `&& web-ext build --overwrite-dest `
|
||||
+ `--source-dir ../dist/ext `
|
||||
+ `--source-dir ../dist/ext/unpacked `
|
||||
+ `--artifacts-dir ../dist/ext `
|
||||
, {
|
||||
shell: true
|
||||
}
|
||||
, { shell: true }
|
||||
);
|
||||
|
||||
child.stdout.pipe(process.stdout);
|
||||
child.stderr.pipe(process.stderr);
|
||||
|
||||
child.on("exit", () => {
|
||||
if (argv.package) {
|
||||
fs.remove(path.join(__dirname, "../dist/ext/unpacked"));
|
||||
}
|
||||
});
|
||||
|
||||
17
ext/package-lock.json
generated
17
ext/package-lock.json
generated
@@ -4373,6 +4373,17 @@
|
||||
"requires": {
|
||||
"lodash": "^4.14.0"
|
||||
}
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
|
||||
"integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
"jsonfile": "^4.0.0",
|
||||
"universalify": "^0.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -4477,9 +4488,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.3.tgz",
|
||||
"integrity": "sha512-q6rbdDd1o2mAnQreO7YADIxf/Whx4AHBiRf6d+/cVT8h44ss+lHgxf1FemcqDnQt9X3ct4McHr+JMGlYSsK7Cg==",
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz",
|
||||
"integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.2",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"scripts": {
|
||||
"build": "node build.js",
|
||||
"package": "node build.js --package",
|
||||
"watch": "node build.js --watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
@@ -12,6 +13,7 @@
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"babel-loader": "^8.0.4",
|
||||
"copy-webpack-plugin": "^4.3.1",
|
||||
"fs-extra": "^7.0.1",
|
||||
"minimist": "^1.2.0",
|
||||
"react": "^16.6.1",
|
||||
"react-dom": "^16.6.1",
|
||||
|
||||
@@ -6,7 +6,7 @@ const CopyWebpackPlugin = require("copy-webpack-plugin");
|
||||
|
||||
|
||||
const includePath = path.resolve(__dirname, "src");
|
||||
const outputPath = path.resolve(__dirname, "../dist/ext/");
|
||||
const outputPath = path.resolve(__dirname, "../dist/ext/unpacked");
|
||||
|
||||
module.exports = (env) => ({
|
||||
entry: {
|
||||
|
||||
Reference in New Issue
Block a user