forked from doocs/md
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmanifest.js
More file actions
33 lines (29 loc) · 754 Bytes
/
manifest.js
File metadata and controls
33 lines (29 loc) · 754 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const fs = require("fs");
const manifest = require("./src/manifest.json");
const package = require("./package.json");
switch (process.env.SERVER_ENV) {
case "NETLIFY":
manifest.h5.publicPath = "/";
package.main = "main.js";
break;
case "ELECTRON":
manifest.h5.publicPath = "/";
package.main = "background.js";
break;
default:
manifest.h5.publicPath = "/md/";
package.main = "main.js";
break;
}
const result = JSON.stringify(manifest, null, 2);
fs.writeFile("./src/manifest.json", result, function (err) {
if (err) {
console.error(err);
}
});
const packageRes = JSON.stringify(package, null, 2);
fs.writeFile("./package.json", packageRes, function (err) {
if (err) {
console.error(err);
}
});