1
1
"use strict" ;
2
2
var __awaiter = ( this && this . __awaiter ) || function ( thisArg , _arguments , P , generator ) {
3
+ function adopt ( value ) { return value instanceof P ? value : new P ( function ( resolve ) { resolve ( value ) ; } ) ; }
3
4
return new ( P || ( P = Promise ) ) ( function ( resolve , reject ) {
4
5
function fulfilled ( value ) { try { step ( generator . next ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
5
6
function rejected ( value ) { try { step ( generator [ "throw" ] ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
6
- function step ( result ) { result . done ? resolve ( result . value ) : new P ( function ( resolve ) { resolve ( result . value ) ; } ) . then ( fulfilled , rejected ) ; }
7
+ function step ( result ) { result . done ? resolve ( result . value ) : adopt ( result . value ) . then ( fulfilled , rejected ) ; }
7
8
step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
8
9
} ) ;
9
10
} ;
@@ -12,11 +13,14 @@ var __rest = (this && this.__rest) || function (s, e) {
12
13
for ( var p in s ) if ( Object . prototype . hasOwnProperty . call ( s , p ) && e . indexOf ( p ) < 0 )
13
14
t [ p ] = s [ p ] ;
14
15
if ( s != null && typeof Object . getOwnPropertySymbols === "function" )
15
- for ( var i = 0 , p = Object . getOwnPropertySymbols ( s ) ; i < p . length ; i ++ ) if ( e . indexOf ( p [ i ] ) < 0 )
16
- t [ p [ i ] ] = s [ p [ i ] ] ;
16
+ for ( var i = 0 , p = Object . getOwnPropertySymbols ( s ) ; i < p . length ; i ++ ) {
17
+ if ( e . indexOf ( p [ i ] ) < 0 && Object . prototype . propertyIsEnumerable . call ( s , p [ i ] ) )
18
+ t [ p [ i ] ] = s [ p [ i ] ] ;
19
+ }
17
20
return t ;
18
21
} ;
19
22
Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
23
+ exports . SFCCompiler = void 0 ;
20
24
const component_compiler_utils_1 = require ( "@vue/component-compiler-utils" ) ;
21
25
const postcss_modules_sync_1 = require ( "postcss-modules-sync" ) ;
22
26
const postcss_clean_1 = require ( "./postcss-clean" ) ;
@@ -100,7 +104,7 @@ class SFCCompiler {
100
104
compileTemplate ( filename , template ) {
101
105
const _a = this . template , { preprocessOptions } = _a , options = __rest ( _a , [ "preprocessOptions" ] ) ;
102
106
const functional = 'functional' in template . attrs ;
103
- return Object . assign ( { functional } , component_compiler_utils_1 . compileTemplate ( Object . assign ( { } , options , { source : template . src
107
+ return Object . assign ( { functional } , component_compiler_utils_1 . compileTemplate ( Object . assign ( Object . assign ( { } , options ) , { source : template . src
104
108
? this . read ( template . src , filename )
105
109
: template . content , filename, preprocessLang : template . lang , preprocessOptions : ( template . lang &&
106
110
preprocessOptions &&
@@ -125,7 +129,7 @@ class SFCCompiler {
125
129
. slice ( )
126
130
. concat ( [
127
131
needsCSSModules
128
- ? postcss_modules_sync_1 . default ( Object . assign ( { generateScopedName : '[path][local]-[hash:base64:4]' } , this . style . postcssModulesOptions , { getJSON : ( t ) => {
132
+ ? postcss_modules_sync_1 . default ( Object . assign ( Object . assign ( { generateScopedName : '[path][local]-[hash:base64:4]' } , this . style . postcssModulesOptions ) , { getJSON : ( t ) => {
129
133
tokens = t ;
130
134
} } ) )
131
135
: undefined ,
@@ -152,7 +156,7 @@ class SFCCompiler {
152
156
preprocessOptions,
153
157
trim : this . style . trim
154
158
} ,
155
- prepare : result => ( Object . assign ( { media : typeof style . attrs . media === 'string' ? style . attrs . media : undefined , scoped : style . scoped , moduleName : style . module === true ? '$style' : style . module , module : tokens } , result , { code : result . code } ) )
159
+ prepare : result => ( Object . assign ( Object . assign ( { media : typeof style . attrs . media === 'string' ? style . attrs . media : undefined , scoped : style . scoped , moduleName : style . module === true ? '$style' : style . module , module : tokens } , result ) , { code : result . code } ) )
156
160
} ;
157
161
}
158
162
read ( filename , context ) {
0 commit comments