This repository was archived by the owner on Sep 9, 2021. It is now read-only.
File tree 4 files changed +28
-0
lines changed
4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ const w1 = require ( './w1.js' ) ;
2
+ const w2 = require ( './w2.js' ) ;
Original file line number Diff line number Diff line change
1
+ // w1 inlined via options
Original file line number Diff line number Diff line change
1
+ // w2 inlined via options
Original file line number Diff line number Diff line change @@ -92,4 +92,28 @@ describe('worker-loader', () => {
92
92
assert . notEqual ( readFile ( bundleFile ) . indexOf ( '// inlined worker test mark' ) , - 1 ) ;
93
93
} )
94
94
) ;
95
+
96
+ it ( 'should inline worker with inline in options' , ( ) =>
97
+ makeBundle ( 'inline-options' , {
98
+ module : {
99
+ rules : [
100
+ {
101
+ test : / ( w 1 | w 2 ) \. j s $ / ,
102
+ loader : '../index.js' ,
103
+ options : {
104
+ inline : true ,
105
+ } ,
106
+ } ,
107
+ ] ,
108
+ } ,
109
+ } ) . then ( ( stats ) => {
110
+ const bundleFile = stats . toJson ( 'minimal' ) . chunks
111
+ . map ( item => item . files )
112
+ . reduce ( ( acc , item ) => acc . concat ( item ) , [ ] )
113
+ . map ( item => `expected/inline-options/${ item } ` ) [ 0 ] ;
114
+ assert ( bundleFile ) ;
115
+ assert . notEqual ( readFile ( bundleFile ) . indexOf ( '// w1 inlined via options' ) , - 1 ) ;
116
+ assert . notEqual ( readFile ( bundleFile ) . indexOf ( '// w2 inlined via options' ) , - 1 ) ;
117
+ } )
118
+ ) ;
95
119
} ) ;
You can’t perform that action at this time.
0 commit comments