File tree 2 files changed +14
-11
lines changed
2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ const laravelModule: Module<Options> = function(_moduleOptions) {
256
256
: [ outputDir === publicDir ? 'spa.html' : 'index.html' , outputDir ]
257
257
258
258
// update nuxt router base if necessary
259
- const outputUrl = outputDir . replace ( publicDir , '' )
259
+ const outputUrl = destDir . replace ( publicDir , '' )
260
260
if (
261
261
outputUrl &&
262
262
( ! this . options . router || this . options . router . base !== outputUrl )
@@ -291,14 +291,14 @@ const laravelModule: Module<Options> = function(_moduleOptions) {
291
291
) {
292
292
const envPath = path . join ( laravelRoot , '.env' )
293
293
const envInput = fs . readFileSync ( envPath ) . toString ( )
294
- const envOutput = `${ EOL } # Added by 'nuxt-laravel' module${ EOL } ${ nuxtOutputEnv } =${ path . join (
295
- destDir ,
296
- fileName
297
- ) } `
294
+ const envOutputPrefix = `${ EOL } # Added by 'nuxt-laravel' module${ EOL } ${ nuxtOutputEnv } `
295
+ const envOutput = `${ envOutputPrefix } =${ path . join ( destDir , fileName ) } `
298
296
299
297
fs . writeFileSync (
300
298
envPath ,
301
- envInput . includes ( nuxtOutputEnv )
299
+ envInput . includes ( envOutputPrefix )
300
+ ? envInput . replace ( new RegExp ( `${ envOutputPrefix } .*` ) , envOutput )
301
+ : envInput . includes ( nuxtOutputEnv )
302
302
? envInput . replace ( new RegExp ( `${ nuxtOutputEnv } .*` ) , envOutput )
303
303
: envInput . concat ( envOutput )
304
304
)
You can’t perform that action at this time.
0 commit comments