@@ -22,7 +22,7 @@ describe('loader', () => {
22
22
const stats = await compile ( compiler ) ;
23
23
24
24
expect (
25
- getModuleSource ( './global-commonjs2-single-export.js -exposed' , stats )
25
+ getModuleSource ( './global-commonjs2-single-export-exposed.js ' , stats )
26
26
) . toMatchSnapshot ( 'module' ) ;
27
27
expect (
28
28
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -39,7 +39,7 @@ describe('loader', () => {
39
39
const stats = await compile ( compiler ) ;
40
40
41
41
expect (
42
- getModuleSource ( './global-commonjs2-multiple-exports.js -exposed' , stats )
42
+ getModuleSource ( './global-commonjs2-multiple-exports-exposed.js ' , stats )
43
43
) . toMatchSnapshot ( 'module' ) ;
44
44
expect (
45
45
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -56,7 +56,7 @@ describe('loader', () => {
56
56
const stats = await compile ( compiler ) ;
57
57
58
58
expect (
59
- getModuleSource ( './global-commonjs2-single-export.js -exposed' , stats )
59
+ getModuleSource ( './global-commonjs2-single-export-exposed.js ' , stats )
60
60
) . toMatchSnapshot ( 'module' ) ;
61
61
expect (
62
62
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -73,7 +73,7 @@ describe('loader', () => {
73
73
const stats = await compile ( compiler ) ;
74
74
75
75
expect (
76
- getModuleSource ( './global-commonjs2-multiple-exports.js -exposed' , stats )
76
+ getModuleSource ( './global-commonjs2-multiple-exports-exposed.js ' , stats )
77
77
) . toMatchSnapshot ( 'module' ) ;
78
78
expect (
79
79
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -90,7 +90,7 @@ describe('loader', () => {
90
90
const stats = await compile ( compiler ) ;
91
91
92
92
expect (
93
- getModuleSource ( './global-commonjs2-single-export.js -exposed' , stats )
93
+ getModuleSource ( './global-commonjs2-single-export-exposed.js ' , stats )
94
94
) . toMatchSnapshot ( 'module' ) ;
95
95
expect (
96
96
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -107,7 +107,7 @@ describe('loader', () => {
107
107
const stats = await compile ( compiler ) ;
108
108
109
109
expect (
110
- getModuleSource ( './global-commonjs2-single-export.js -exposed' , stats )
110
+ getModuleSource ( './global-commonjs2-single-export-exposed.js ' , stats )
111
111
) . toMatchSnapshot ( 'module' ) ;
112
112
expect (
113
113
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -123,7 +123,7 @@ describe('loader', () => {
123
123
const stats = await compile ( compiler ) ;
124
124
125
125
expect (
126
- getModuleSource ( './global-module-default-export.js -exposed' , stats )
126
+ getModuleSource ( './global-module-default-export-exposed.js ' , stats )
127
127
) . toMatchSnapshot ( 'module' ) ;
128
128
expect (
129
129
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -145,7 +145,7 @@ describe('loader', () => {
145
145
const stats = await compile ( compiler ) ;
146
146
147
147
expect (
148
- getModuleSource ( './global-module-named-exports.js -exposed' , stats )
148
+ getModuleSource ( './global-module-named-exports-exposed.js ' , stats )
149
149
) . toMatchSnapshot ( 'module' ) ;
150
150
expect (
151
151
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -167,7 +167,7 @@ describe('loader', () => {
167
167
const stats = await compile ( compiler ) ;
168
168
169
169
expect (
170
- getModuleSource ( './global-module-named-exports.js -exposed' , stats )
170
+ getModuleSource ( './global-module-named-exports-exposed.js ' , stats )
171
171
) . toMatchSnapshot ( 'module' ) ;
172
172
expect (
173
173
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -186,7 +186,7 @@ describe('loader', () => {
186
186
const stats = await compile ( compiler ) ;
187
187
188
188
expect (
189
- getModuleSource ( './global-module-named-exports.js -exposed' , stats )
189
+ getModuleSource ( './global-module-named-exports-exposed.js ' , stats )
190
190
) . toMatchSnapshot ( 'module' ) ;
191
191
expect (
192
192
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -212,7 +212,7 @@ describe('loader', () => {
212
212
const stats = await compile ( compiler ) ;
213
213
214
214
expect (
215
- getModuleSource ( './global-module-named-exports.js -exposed' , stats )
215
+ getModuleSource ( './global-module-named-exports-exposed.js ' , stats )
216
216
) . toMatchSnapshot ( 'module' ) ;
217
217
expect (
218
218
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -259,7 +259,7 @@ describe('loader', () => {
259
259
const stats = await compile ( compiler ) ;
260
260
261
261
expect (
262
- getModuleSource ( './custom.js?foo=bar-exposed ' , stats )
262
+ getModuleSource ( './custom-exposed .js?foo=bar' , stats )
263
263
) . toMatchSnapshot ( 'module' ) ;
264
264
expect (
265
265
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -269,6 +269,39 @@ describe('loader', () => {
269
269
expect ( getWarnings ( stats ) ) . toMatchSnapshot ( 'warnings' ) ;
270
270
} ) ;
271
271
272
+ it ( 'should work inline 1 without extension' , async ( ) => {
273
+ const compiler = getCompiler (
274
+ 'inline-import-1.js' ,
275
+ { } ,
276
+ {
277
+ devtool : 'source-map' ,
278
+ module : {
279
+ rules : [
280
+ {
281
+ test : / .* c u s t o m / i,
282
+ use : [
283
+ {
284
+ loader : 'babel-loader' ,
285
+ } ,
286
+ ] ,
287
+ } ,
288
+ ] ,
289
+ } ,
290
+ }
291
+ ) ;
292
+ const stats = await compile ( compiler ) ;
293
+
294
+ expect ( getModuleSource ( './custom-exposed?foo=bar' , stats ) ) . toMatchSnapshot (
295
+ 'module'
296
+ ) ;
297
+ expect (
298
+ execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
299
+ ) . toMatchSnapshot ( 'result' ) ;
300
+ expect ( readAsset ( 'main.bundle.js.map' , compiler , stats ) ) . toBeDefined ( ) ;
301
+ expect ( getErrors ( stats ) ) . toMatchSnapshot ( 'errors' ) ;
302
+ expect ( getWarnings ( stats ) ) . toMatchSnapshot ( 'warnings' ) ;
303
+ } ) ;
304
+
272
305
it ( 'should work inline 2' , async ( ) => {
273
306
const compiler = getCompiler (
274
307
'inline-import-2.js' ,
@@ -280,7 +313,7 @@ describe('loader', () => {
280
313
const stats = await compile ( compiler ) ;
281
314
282
315
expect (
283
- getModuleSource ( './simple-commonjs2-single-export.js -exposed' , stats )
316
+ getModuleSource ( './simple-commonjs2-single-export-exposed.js ' , stats )
284
317
) . toMatchSnapshot ( 'module' ) ;
285
318
expect (
286
319
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
@@ -307,17 +340,17 @@ describe('loader', () => {
307
340
) ;
308
341
const stats = await compile ( compiler ) ;
309
342
const module = stats . compilation . modules . find ( ( m ) =>
310
- m . id . endsWith ( './simple-commonjs2-single-export.js -exposed' )
343
+ m . id . endsWith ( './simple-commonjs2-single-export-exposed.js ' )
311
344
) ;
312
345
const isWebpack5 = webpack . version [ 0 ] === '5' ;
313
346
314
347
expect (
315
- getModuleSource ( './simple-commonjs2-single-export.js -exposed' , stats )
348
+ getModuleSource ( './simple-commonjs2-single-export-exposed.js ' , stats )
316
349
) . toMatchSnapshot ( 'module' ) ;
317
350
expect ( module . hash ) . toBe (
318
351
isWebpack5
319
- ? 'c440ca2d9d70459fecf24e8109d10515 '
320
- : 'e8401602c3b42c066e582bcd1f72cb36 '
352
+ ? '60f98cee3e481afa035cc5b317197b92 '
353
+ : '18981954a65740f4957667890c5b154b '
321
354
) ;
322
355
expect ( getErrors ( stats ) ) . toMatchSnapshot ( 'errors' ) ;
323
356
expect ( getWarnings ( stats ) ) . toMatchSnapshot ( 'warnings' ) ;
@@ -351,7 +384,7 @@ describe('loader', () => {
351
384
const stats = await compile ( compiler ) ;
352
385
353
386
expect (
354
- getModuleSource ( './global-commonjs2-single-export.js -exposed' , stats )
387
+ getModuleSource ( './global-commonjs2-single-export-exposed.js ' , stats )
355
388
) . toMatchSnapshot ( 'module' ) ;
356
389
expect (
357
390
execute ( readAsset ( 'main.bundle.js' , compiler , stats ) )
0 commit comments