File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -5,21 +5,27 @@ module.exports = function NuxtLoadingScreen () {
55 return
66 }
77
8+ const baseURL = nuxt . options . router . base + '_loading'
9+ nuxt . options . _loadingScreenBaseURL = baseURL
10+
811 const LoadingUI = require ( './loading' )
912
10- const loading = new LoadingUI ( {
11- baseURL : nuxt . options . router . base + '_loading'
12- } )
13+ const loading = new LoadingUI ( { baseURL } )
1314
1415 nuxt . options . serverMiddleware . push ( {
1516 path : '/_loading' ,
1617 handler : ( req , res ) => { loading . app ( req , res ) }
1718 } )
1819
19- nuxt . hook ( 'listen' , async ( _ , { url } ) => {
20- await loading . initAlt ( { url } )
21- nuxt . options . _loadingScreenBaseURL = loading . baseURLAlt
22- } )
20+ if (
21+ nuxt . options . loading . altPort !== false &&
22+ ! process . env . CODESANDBOX_SSE
23+ ) {
24+ nuxt . hook ( 'listen' , async ( _ , { url } ) => {
25+ await loading . initAlt ( { url } )
26+ nuxt . options . _loadingScreenBaseURL = loading . baseURLAlt
27+ } )
28+ }
2329
2430 nuxt . hook ( 'close' , async ( ) => {
2531 await loading . close ( )
You can’t perform that action at this time.
0 commit comments