You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
1.2 KiB
27 lines
1.2 KiB
"use strict";
|
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
const chalk_1 = __importDefault(require("chalk"));
|
|
const expo_pwa_1 = require("expo-pwa");
|
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
const PwaManifestWebpackPlugin_1 = __importDefault(require("./PwaManifestWebpackPlugin"));
|
|
class ExpoPwaManifestWebpackPlugin extends PwaManifestWebpackPlugin_1.default {
|
|
constructor(pwaOptions, config) {
|
|
let inputJson;
|
|
try {
|
|
if (fs_extra_1.default.existsSync(pwaOptions.template)) {
|
|
inputJson = JSON.parse(fs_extra_1.default.readFileSync(pwaOptions.template, { encoding: 'utf8' }));
|
|
}
|
|
}
|
|
catch ({ message }) {
|
|
console.log(chalk_1.default.yellow(`\u203A PWA manifest: failed to use template file: ${message}`));
|
|
}
|
|
if (!inputJson)
|
|
inputJson = (0, expo_pwa_1.generateManifestJson)({}, config);
|
|
super(pwaOptions, inputJson);
|
|
}
|
|
}
|
|
exports.default = ExpoPwaManifestWebpackPlugin;
|
|
//# sourceMappingURL=ExpoPwaManifestWebpackPlugin.js.map
|