File tree 2 files changed +29
-1
lines changed
src/server/webpack-plugin
2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,20 @@ export default class VueSSRClientPlugin {
19
19
const initialFiles = uniq ( Object . keys ( stats . entrypoints )
20
20
. map ( name => stats . entrypoints [ name ] . assets )
21
21
. reduce ( ( assets , all ) => all . concat ( assets ) , [ ] )
22
+ . map ( function ( file ) {
23
+ if ( typeof file === "string" ) {
24
+ return file ;
25
+ }
26
+
27
+ if (
28
+ Object . prototype . toString . call ( file ) === "[object Object]" &&
29
+ file . name
30
+ ) {
31
+ return file . name ;
32
+ }
33
+
34
+ throw new Error ( `file structure is not correct: ${ file } ` ) ;
35
+ } )
22
36
. filter ( ( file ) => isJS ( file ) || isCSS ( file ) ) )
23
37
24
38
const asyncFiles = allFiles
Original file line number Diff line number Diff line change @@ -20,7 +20,21 @@ export default class VueSSRServerPlugin {
20
20
return cb ( )
21
21
}
22
22
23
- const entryAssets = entryInfo . assets . filter ( isJS )
23
+ const entryAssets = entryInfo . assets
24
+ . map ( function ( file ) {
25
+ if ( typeof file === "string" ) {
26
+ return file ;
27
+ }
28
+
29
+ if (
30
+ Object . prototype . toString . call ( file ) === "[object Object]" &&
31
+ file . name
32
+ ) {
33
+ return file . name ;
34
+ }
35
+
36
+ throw new Error ( `file structure is not correct: ${ file } ` ) ;
37
+ } ) . filter ( isJS )
24
38
25
39
if ( entryAssets . length > 1 ) {
26
40
throw new Error (
You can’t perform that action at this time.
0 commit comments