@tramvai/cli 2.103.1 → 2.104.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/library/webpack/blocks/pwa/client.js +13 -1
- package/lib/library/webpack/blocks/pwa/client.js.map +1 -1
- package/lib/schema/autogeneratedSchema.json +17 -0
- package/lib/typings/configEntry/application.d.ts +8 -0
- package/lib/typings/pwa/index.d.ts +1 -0
- package/package.json +2 -2
- package/schema.json +17 -0
- package/src/library/webpack/blocks/pwa/client.ts +13 -0
- package/src/schema/autogeneratedSchema.json +17 -0
- package/src/typings/configEntry/application.ts +8 -0
- package/src/typings/pwa/index.ts +1 -0
|
@@ -7,7 +7,9 @@ const workbox_webpack_plugin_1 = require("workbox-webpack-plugin");
|
|
|
7
7
|
const PwaIconsPlugin_1 = require("../../plugins/PwaIconsPlugin");
|
|
8
8
|
const WebManifestPlugin_1 = require("../../plugins/WebManifestPlugin");
|
|
9
9
|
const shared_1 = require("./shared");
|
|
10
|
-
const pwaBlock =
|
|
10
|
+
const pwaBlock =
|
|
11
|
+
// eslint-disable-next-line max-statements
|
|
12
|
+
(configManager) => (config) => {
|
|
11
13
|
var _a, _b, _c, _d, _e;
|
|
12
14
|
const { experiments: { pwa }, rootDir, root, output, env, modern, sourceMap, assetsPrefix, } = configManager;
|
|
13
15
|
config.batch((0, shared_1.pwaSharedBlock)(configManager));
|
|
@@ -22,7 +24,17 @@ const pwaBlock = (configManager) => (config) => {
|
|
|
22
24
|
// @todo maybe less for production?
|
|
23
25
|
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
|
|
24
26
|
};
|
|
27
|
+
if (pwa.workbox.include) {
|
|
28
|
+
workboxOptions.include = pwa.workbox.include.map((expr) => new RegExp(expr));
|
|
29
|
+
}
|
|
30
|
+
if (pwa.workbox.exclude) {
|
|
31
|
+
workboxOptions.exclude = [
|
|
32
|
+
...workboxOptions.exclude,
|
|
33
|
+
...pwa.workbox.exclude.map((expr) => new RegExp(expr)),
|
|
34
|
+
];
|
|
35
|
+
}
|
|
25
36
|
if (env === 'production') {
|
|
37
|
+
workboxOptions.dontCacheBustURLsMatching = /\/\w+?\.[\w\d]+?\.(js|css|gif|png|jpe?g|svg)$/;
|
|
26
38
|
workboxOptions.modifyURLPrefix = {
|
|
27
39
|
'': assetsPrefix,
|
|
28
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/library/webpack/blocks/pwa/client.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AAExB,mEAAwD;AAGxD,iEAA8D;AAC9D,uEAAoE;AACpE,qCAA0C;AAEnC,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../src/library/webpack/blocks/pwa/client.ts"],"names":[],"mappings":";;;;AAAA,wDAAwB;AAExB,mEAAwD;AAGxD,iEAA8D;AAC9D,uEAAoE;AACpE,qCAA0C;AAEnC,MAAM,QAAQ;AACnB,0CAA0C;AAC1C,CAAC,aAAoD,EAAE,EAAE,CAAC,CAAC,MAAc,EAAE,EAAE;;IAC3E,MAAM,EACJ,WAAW,EAAE,EAAE,GAAG,EAAE,EACpB,OAAO,EACP,IAAI,EACJ,MAAM,EACN,GAAG,EACH,MAAM,EACN,SAAS,EACT,YAAY,GACb,GAAG,aAAa,CAAC;IAElB,MAAM,CAAC,KAAK,CAAC,IAAA,uBAAc,EAAC,aAAa,CAAC,CAAC,CAAC;IAE5C,iEAAiE;IAEjE,IAAI,MAAA,GAAG,CAAC,OAAO,0CAAE,OAAO,EAAE;QACxB,6BAA6B;QAC7B,0EAA0E;QAC1E,MAAM,cAAc,GAA6B;YAC/C,KAAK,EAAE,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,MAAA,GAAG,CAAC,EAAE,0CAAE,GAAG,CAAC;YAC5C,MAAM,EAAE,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,C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;QACrC,wEAAwE;QACxE,IAAI,SAAS,EAAE;YACb,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC;SAClD;QAED,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;KAC7C;IAED,IAAI,MAAA,GAAG,CAAC,WAAW,0CAAE,OAAO,EAAE;QAC5B,MAAM,iBAAiB,GAAG,IAAI,qCAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;QAEjE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;KACrD;IAED,IAAI,MAAA,GAAG,CAAC,IAAI,0CAAE,GAAG,EAAE;QACjB,MAAM,OAAO,GAAG,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACvD,MAAM,cAAc,GAAG,IAAI,+BAAc,iCAAM,GAAG,CAAC,IAAI,KAAE,GAAG,EAAE,OAAO,IAAG,CAAC;QAEzE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;KAChD;AACH,CAAC,CAAC;AAtFS,QAAA,QAAQ,YAsFjB"}
|
|
@@ -579,6 +579,20 @@
|
|
|
579
579
|
"type": "boolean"
|
|
580
580
|
}
|
|
581
581
|
]
|
|
582
|
+
},
|
|
583
|
+
"exclude": {
|
|
584
|
+
"title": "Array of regexp specifiers used to exclude assets from the precache manifest",
|
|
585
|
+
"type": "array",
|
|
586
|
+
"items": {
|
|
587
|
+
"type": "string"
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
"include": {
|
|
591
|
+
"title": "Array of regexp specifiers used to include assets in the precache manifest",
|
|
592
|
+
"type": "array",
|
|
593
|
+
"items": {
|
|
594
|
+
"type": "string"
|
|
595
|
+
}
|
|
582
596
|
}
|
|
583
597
|
},
|
|
584
598
|
"additionalProperties": false
|
|
@@ -641,6 +655,9 @@
|
|
|
641
655
|
},
|
|
642
656
|
"density": {
|
|
643
657
|
"type": "number"
|
|
658
|
+
},
|
|
659
|
+
"purpose": {
|
|
660
|
+
"type": "string"
|
|
644
661
|
}
|
|
645
662
|
},
|
|
646
663
|
"additionalProperties": false
|
|
@@ -56,6 +56,14 @@ export interface ApplicationExperiments extends Experiments {
|
|
|
56
56
|
* @default false
|
|
57
57
|
*/
|
|
58
58
|
enabled?: OverridableOption<boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* @title Array of regexp specifiers used to exclude assets from the precache manifest
|
|
61
|
+
*/
|
|
62
|
+
exclude?: string[];
|
|
63
|
+
/**
|
|
64
|
+
* @title Array of regexp specifiers used to include assets in the precache manifest
|
|
65
|
+
*/
|
|
66
|
+
include?: string[];
|
|
59
67
|
};
|
|
60
68
|
/**
|
|
61
69
|
* @title WebManifest content (manifest.json or webmanifest will be generated based on this options)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.104.0",
|
|
4
4
|
"description": "Cli инструмент для сборки и запуска приложений",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"@tinkoff/utils": "^2.1.3",
|
|
72
72
|
"@tinkoff/webpack-dedupe-plugin": "1.0.5",
|
|
73
73
|
"@tramvai/build": "3.1.3",
|
|
74
|
-
"@tramvai/react": "2.
|
|
74
|
+
"@tramvai/react": "2.104.0",
|
|
75
75
|
"@tramvai/tools-check-versions": "0.4.14",
|
|
76
76
|
"@tramvai/tools-migrate": "0.6.18",
|
|
77
77
|
"ajv": "^6.12.6",
|
package/schema.json
CHANGED
|
@@ -600,6 +600,20 @@
|
|
|
600
600
|
"type": "boolean"
|
|
601
601
|
}
|
|
602
602
|
]
|
|
603
|
+
},
|
|
604
|
+
"exclude": {
|
|
605
|
+
"title": "Array of regexp specifiers used to exclude assets from the precache manifest",
|
|
606
|
+
"type": "array",
|
|
607
|
+
"items": {
|
|
608
|
+
"type": "string"
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
"include": {
|
|
612
|
+
"title": "Array of regexp specifiers used to include assets in the precache manifest",
|
|
613
|
+
"type": "array",
|
|
614
|
+
"items": {
|
|
615
|
+
"type": "string"
|
|
616
|
+
}
|
|
603
617
|
}
|
|
604
618
|
},
|
|
605
619
|
"additionalProperties": false
|
|
@@ -662,6 +676,9 @@
|
|
|
662
676
|
},
|
|
663
677
|
"density": {
|
|
664
678
|
"type": "number"
|
|
679
|
+
},
|
|
680
|
+
"purpose": {
|
|
681
|
+
"type": "string"
|
|
665
682
|
}
|
|
666
683
|
},
|
|
667
684
|
"additionalProperties": false
|
|
@@ -8,6 +8,7 @@ import { WebManifestPlugin } from '../../plugins/WebManifestPlugin';
|
|
|
8
8
|
import { pwaSharedBlock } from './shared';
|
|
9
9
|
|
|
10
10
|
export const pwaBlock =
|
|
11
|
+
// eslint-disable-next-line max-statements
|
|
11
12
|
(configManager: ConfigManager<ApplicationConfigEntry>) => (config: Config) => {
|
|
12
13
|
const {
|
|
13
14
|
experiments: { pwa },
|
|
@@ -35,7 +36,19 @@ export const pwaBlock =
|
|
|
35
36
|
maximumFileSizeToCacheInBytes: 10 * 1024 * 1024,
|
|
36
37
|
};
|
|
37
38
|
|
|
39
|
+
if (pwa.workbox.include) {
|
|
40
|
+
workboxOptions.include = pwa.workbox.include.map((expr) => new RegExp(expr));
|
|
41
|
+
}
|
|
42
|
+
if (pwa.workbox.exclude) {
|
|
43
|
+
workboxOptions.exclude = [
|
|
44
|
+
...workboxOptions.exclude,
|
|
45
|
+
...pwa.workbox.exclude.map((expr) => new RegExp(expr)),
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
|
|
38
49
|
if (env === 'production') {
|
|
50
|
+
workboxOptions.dontCacheBustURLsMatching = /\/\w+?\.[\w\d]+?\.(js|css|gif|png|jpe?g|svg)$/;
|
|
51
|
+
|
|
39
52
|
workboxOptions.modifyURLPrefix = {
|
|
40
53
|
'': assetsPrefix,
|
|
41
54
|
};
|
|
@@ -579,6 +579,20 @@
|
|
|
579
579
|
"type": "boolean"
|
|
580
580
|
}
|
|
581
581
|
]
|
|
582
|
+
},
|
|
583
|
+
"exclude": {
|
|
584
|
+
"title": "Array of regexp specifiers used to exclude assets from the precache manifest",
|
|
585
|
+
"type": "array",
|
|
586
|
+
"items": {
|
|
587
|
+
"type": "string"
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
"include": {
|
|
591
|
+
"title": "Array of regexp specifiers used to include assets in the precache manifest",
|
|
592
|
+
"type": "array",
|
|
593
|
+
"items": {
|
|
594
|
+
"type": "string"
|
|
595
|
+
}
|
|
582
596
|
}
|
|
583
597
|
},
|
|
584
598
|
"additionalProperties": false
|
|
@@ -641,6 +655,9 @@
|
|
|
641
655
|
},
|
|
642
656
|
"density": {
|
|
643
657
|
"type": "number"
|
|
658
|
+
},
|
|
659
|
+
"purpose": {
|
|
660
|
+
"type": "string"
|
|
644
661
|
}
|
|
645
662
|
},
|
|
646
663
|
"additionalProperties": false
|
|
@@ -60,6 +60,14 @@ export interface ApplicationExperiments extends Experiments {
|
|
|
60
60
|
* @default false
|
|
61
61
|
*/
|
|
62
62
|
enabled?: OverridableOption<boolean>;
|
|
63
|
+
/**
|
|
64
|
+
* @title Array of regexp specifiers used to exclude assets from the precache manifest
|
|
65
|
+
*/
|
|
66
|
+
exclude?: string[];
|
|
67
|
+
/**
|
|
68
|
+
* @title Array of regexp specifiers used to include assets in the precache manifest
|
|
69
|
+
*/
|
|
70
|
+
include?: string[];
|
|
63
71
|
};
|
|
64
72
|
/**
|
|
65
73
|
* @title WebManifest content (manifest.json or webmanifest will be generated based on this options)
|