File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -4,13 +4,15 @@ const { getOptions } = require('loader-utils');
4
4
const { statSync, utimesSync, writeFileSync } = require ( 'fs' ) ;
5
5
const { tmpdir } = require ( 'os' ) ;
6
6
7
+ const hotApi = require . resolve ( './lib/hot-api.js' ) ;
8
+
7
9
function makeHot ( id , code , hotOptions ) {
8
10
const options = JSON . stringify ( hotOptions ) ;
9
11
const replacement = `
10
12
11
13
if (module.hot) {
12
14
13
- const { configure, register, reload } = require('svelte-loader/lib/hot-api ');
15
+ const { configure, register, reload } = require('${ hotApi } ');
14
16
15
17
module.hot.accept();
16
18
Original file line number Diff line number Diff line change @@ -404,6 +404,19 @@ describe('loader', () => {
404
404
}
405
405
)
406
406
) ;
407
+
408
+ it (
409
+ 'should require resolved hot-api.js' ,
410
+ testLoader (
411
+ 'test/fixtures/good.html' ,
412
+ function ( err , code , map ) {
413
+ expect ( err ) . not . to . exist ;
414
+
415
+ expect ( code ) . to . contain ( require . resolve ( '../lib/hot-api.js' ) ) ;
416
+ } ,
417
+ { hotReload : true }
418
+ )
419
+ ) ;
407
420
} ) ;
408
421
} ) ;
409
422
} ) ;
You can’t perform that action at this time.
0 commit comments