@@ -5,33 +5,41 @@ const MODES = {
55
66module . exports = {
77 MODES ,
8- getDefaults : options => ( {
9- mode : MODES . postcss ,
10- enabled : options . dev === false ,
11- paths : [
12- 'components/**/*.vue' ,
13- 'layouts/**/*.vue' ,
14- 'pages/**/*.vue' ,
15- 'plugins/**/*.js' ,
16- 'nuxt.config.js'
17- ] ,
18- styleExtensions : [ '.css' ] ,
19- whitelist : [ 'body' , 'html' , 'nuxt-progress' , '__nuxt' , '__layout' ] ,
20- whitelistPatterns : [
21- / - ( l e a v e | e n t e r | a p p e a r ) ( | - ( t o | f r o m | a c t i v e ) ) $ / , // Normal transitions
22- / ^ n u x t - l i n k ( | - e x a c t ) - a c t i v e $ / , // Nuxt link classes
23- / ^ (? ! c u r s o r - m o v e ) .+ - m o v e $ / , // Move transitions
24- / d a t a - v - .* / // Keep scoped styles
25- ] ,
26- whitelistPatternsChildren : [ ] ,
27- extractors : [
28- {
29- extractor : ( content ) => {
30- const contentWithoutStyleBlocks = content . replace ( / < s t y l e [ ^ ] + ?< \/ s t y l e > / gi, '' ) // Remove inline vue styles
31- return contentWithoutStyleBlocks . match ( / [ \w - . : / ] + (?< ! : ) / g) || [ ]
32- } ,
33- extensions : [ 'html' , 'vue' , 'js' ]
34- }
35- ]
36- } )
8+ getDefaults ( options ) {
9+ const defaults = {
10+ mode : MODES . postcss ,
11+ enabled : options . dev === false ,
12+ paths : [
13+ 'components/**/*.vue' ,
14+ 'layouts/**/*.vue' ,
15+ 'pages/**/*.vue' ,
16+ 'plugins/**/*.js' ,
17+ 'nuxt.config.js'
18+ ] ,
19+ styleExtensions : [ '.css' ] ,
20+ whitelist : [ 'body' , 'html' , 'nuxt-progress' , '__nuxt' , '__layout' ] ,
21+ whitelistPatterns : [
22+ / - ( l e a v e | e n t e r | a p p e a r ) ( | - ( t o | f r o m | a c t i v e ) ) $ / , // Normal transitions
23+ / ^ n u x t - l i n k ( | - e x a c t ) - a c t i v e $ / , // Nuxt link classes
24+ / ^ (? ! c u r s o r - m o v e ) .+ - m o v e $ / , // Move transitions
25+ / d a t a - v - .* / // Keep scoped styles
26+ ] ,
27+ whitelistPatternsChildren : [ ] ,
28+ extractors : [
29+ {
30+ extractor : ( content ) => {
31+ const contentWithoutStyleBlocks = content . replace ( / < s t y l e [ ^ ] + ?< \/ s t y l e > / gi, '' ) // Remove inline vue styles
32+ return contentWithoutStyleBlocks . match ( / [ \w - . : / ] + (?< ! : ) / g) || [ ]
33+ } ,
34+ extensions : [ 'html' , 'vue' , 'js' ]
35+ }
36+ ]
37+ }
38+
39+ if ( options . dev ) {
40+ defaults . whitelist . push ( 'nuxt__build_indicator' )
41+ }
42+
43+ return defaults
44+ }
3745}
0 commit comments