mirror of
https://github.com/doocs/md.git
synced 2024-11-24 19:10:34 +08:00
22 lines
549 B
JavaScript
22 lines
549 B
JavaScript
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);
|
|
|
|
manifest.h5.publicPath =
|
|
process.env.SERVER_ENV !== "NETLIFY" ? "/md/" : "/";
|
|
const result = JSON.stringify(manifest, null, 2);
|
|
|
|
fs.writeFile("./src/manifest.json", result, function (err) {
|
|
if (err) {
|
|
console.error(err);
|
|
}
|
|
});
|
|
});
|
|
}
|
|
writeManifestJson();
|