@@ -62,6 +62,20 @@ export class BundleSource {
62
62
*/
63
63
public init ( ) {
64
64
this . concat . add ( null , "(function(FuseBox){FuseBox.$fuse$=FuseBox;" ) ;
65
+
66
+ // handle server bundle
67
+ if ( this . context . target ) {
68
+ this . concat . add ( null , `FuseBox.target = "${ this . context . target } "` ) ;
69
+ }
70
+
71
+ if ( this . context . serverBundle ) {
72
+ this . concat . add ( null , `FuseBox.isServer = true;` ) ;
73
+ }
74
+
75
+ if ( this . context . fuse . producer && this . context . fuse . producer . allowSyntheticDefaultImports ) {
76
+ this . concat . add ( null , `// allowSyntheticDefaultImports` ) ;
77
+ this . concat . add ( null , `FuseBox.sdep = true` ) ;
78
+ }
65
79
}
66
80
67
81
public annotate ( comment : string ) {
@@ -190,19 +204,6 @@ ${file.headerContent ? file.headerContent.join("\n") : ""}`);
190
204
191
205
let mainEntry ;
192
206
193
- // handle server bundle
194
- if ( this . context . target ) {
195
- this . concat . add ( null , `FuseBox.target = "${ this . context . target } "` ) ;
196
- }
197
-
198
- if ( context . serverBundle ) {
199
- this . concat . add ( null , `FuseBox.isServer = true;` ) ;
200
- }
201
-
202
- if ( context . fuse . producer && context . fuse . producer . allowSyntheticDefaultImports ) {
203
- this . concat . add ( null , `// allowSyntheticDefaultImports` ) ;
204
- this . concat . add ( null , `FuseBox.sdep = true` ) ;
205
- }
206
207
// writing other bundles info
207
208
if ( this . bundleInfoObject ) {
208
209
this . concat . add ( null , `FuseBox.global("__fsbx__bundles__",${ JSON . stringify ( this . bundleInfoObject ) } )` ) ;
0 commit comments