@@ -24,6 +24,9 @@ module.exports = function nuxt7 (_options) {
24
24
// Disable postcss for less transformations
25
25
this . options . build . postcss = false
26
26
27
+ // Extend webpack config
28
+ this . extendBuild ( config => extendConfig ( config , options ) )
29
+
27
30
// Global theme color
28
31
if ( options . themeColor ) {
29
32
options . build . ios . themeColor = options . themeColor
@@ -40,6 +43,18 @@ module.exports = function nuxt7 (_options) {
40
43
this . addVendor ( 'dom7' )
41
44
this . addVendor ( 'template7' )
42
45
46
+ // Webpack 4 cacheGroup
47
+ if ( this . options . build . optimization ) {
48
+ const { cacheGroups } = this . options . build . optimization . splitChunks
49
+
50
+ cacheGroups . framework7 = {
51
+ test : / n o d e _ m o d u l e s [ \\ / ] ( f r a m e w o r k 7 | f r a m e w o r k 7 - v u e | d o m 7 | t e m p l a t e 7 | s s r - w i n d o w | p a t h - t o - r e g e x p ) [ \\ / ] / ,
52
+ chunks : 'all' ,
53
+ priority : 10 ,
54
+ name : 'framework7'
55
+ }
56
+ }
57
+
43
58
// Remove custom keys for framework7 plugin
44
59
options . plugin = omit ( options , extraKeys )
45
60
@@ -77,9 +92,15 @@ module.exports = function nuxt7 (_options) {
77
92
return Promise . resolve ( )
78
93
}
79
94
80
- // ----------------------------------------------------------
81
- // Add templates
82
- // ----------------------------------------------------------
95
+ function extendConfig ( config , options ) {
96
+ // Increase performance check limits to 2M (non-gzipped)
97
+ const MAX_SIZE = 2 * 1024 * 1024
98
+ Object . assign ( config . performance , {
99
+ maxEntrypointSize : MAX_SIZE ,
100
+ maxAssetSize : MAX_SIZE
101
+ } )
102
+ }
103
+
83
104
function addTemplates ( options ) {
84
105
// Framework7 plugin
85
106
this . addPlugin ( {
0 commit comments