@leanup/cli-pwa
Version:
This module contains pwa features for the @leanup/cli.
23 lines • 905 B
JavaScript
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define(["require", "exports"], factory);
}
})(function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
module.exports = (CLI) => {
CLI.addOptionToCommand(['build', 'serve'], [{ flags: '--pwa [generateSW|injectManifest]', description: 'gernerate pwa manifest and service worker' }]);
CLI.addActionToCommand(['build', 'serve'], (options) => {
const spawnArgs = [];
if (options.pwa) {
spawnArgs.push(`--pwa=${options.pwa}`);
}
return spawnArgs;
});
};
});
//# sourceMappingURL=cli.js.map