1 | (function (factory) {
|
2 | if (typeof module === "object" && typeof module.exports === "object") {
|
3 | var v = factory(require, exports);
|
4 | if (v !== undefined) module.exports = v;
|
5 | }
|
6 | else if (typeof define === "function" && define.amd) {
|
7 | define(["require", "exports"], factory);
|
8 | }
|
9 | })(function (require, exports) {
|
10 | "use strict";
|
11 | Object.defineProperty(exports, "__esModule", { value: true });
|
12 | module.exports = (CLI) => {
|
13 | CLI.addOptionToCommand(['build', 'serve'], [{ flags: '--pwa [generateSW|injectManifest]', description: 'gernerate pwa manifest and service worker' }]);
|
14 | CLI.addActionToCommand(['build', 'serve'], (options) => {
|
15 | const spawnArgs = [];
|
16 | if (options.pwa) {
|
17 | spawnArgs.push(`--pwa=${options.pwa}`);
|
18 | }
|
19 | return spawnArgs;
|
20 | });
|
21 | };
|
22 | });
|
23 |
|
\ | No newline at end of file |