2021-02-28 14:50:52 +08:00
|
|
|
const fs = require("fs");
|
|
|
|
function writeManifestJson() {
|
|
|
|
fs.readFile("./src/manifest.json", function (err, data) {
|
|
|
|
if (err) {
|
|
|
|
return console.error(err);
|
|
|
|
}
|
|
|
|
const strData = data.toString();
|
|
|
|
const manifest = JSON.parse(strData);
|
|
|
|
|
2021-02-28 15:39:35 +08:00
|
|
|
manifest.h5.publicPath =
|
|
|
|
process.env.SERVER_ENV !== "NETLIFY" ? "/md/" : "/";
|
2021-02-28 16:20:26 +08:00
|
|
|
const result = JSON.stringify(manifest, null, 2);
|
2021-02-28 14:50:52 +08:00
|
|
|
|
|
|
|
fs.writeFile("./src/manifest.json", result, function (err) {
|
|
|
|
if (err) {
|
|
|
|
console.error(err);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
writeManifestJson();
|