Commit 0347d90 1 parent 9d47995 commit 0347d90 Copy full SHA for 0347d90
File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -788,6 +788,13 @@ function prepareBrowserContext(
788
788
globals ,
789
789
) ;
790
790
791
+ if ( bundle . env . isLibrary ) {
792
+ ctx . process = {
793
+ browser : true ,
794
+ env : { } ,
795
+ } ;
796
+ }
797
+
791
798
ctx.window = ctx.self = ctx;
792
799
return { ctx , promises } ;
793
800
}
Original file line number Diff line number Diff line change @@ -182,7 +182,7 @@ impl Config {
182
182
}
183
183
184
184
fn insert_node_globals ( & self ) -> bool {
185
- !self . is_node ( ) && self . source_type != SourceType :: Script
185
+ !self . is_node ( ) && self . source_type != SourceType :: Script && ! self . is_library
186
186
}
187
187
188
188
fn replace_env ( & self ) -> bool {
@@ -502,7 +502,7 @@ pub fn transform(
502
502
diagnostics : & mut diagnostics,
503
503
unresolved_mark,
504
504
} ,
505
- config. source_type != SourceType :: Script ,
505
+ config. source_type != SourceType :: Script && !config . is_library ,
506
506
) ,
507
507
paren_remover ( Some ( & comments) ) ,
508
508
// Simplify expressions and remove dead branches so that we
You can’t perform that action at this time.
0 commit comments