Skip to content

Commit 2575165

Browse files
committed
fix(routing): adjust router base correction
1 parent 795de98 commit 2575165

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

lib/module.js

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/module.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ const laravelModule: Module<Options> = function(_moduleOptions) {
148148
this.options.proxy = [
149149
...(this.options.proxy || []),
150150
[
151-
['**/*', `!${path.join(baseUrl, moduleKey)}`],
151+
['**/*', `!/${path.join(baseUrl, moduleKey)}`],
152152
{
153153
target: laravelUrl.origin,
154154
ws: false
@@ -203,6 +203,7 @@ const laravelModule: Module<Options> = function(_moduleOptions) {
203203
)
204204

205205
// try to start artisan serve from laravel path
206+
console.log(nuxtUrl.href)
206207
try {
207208
execa(
208209
'php',
@@ -256,11 +257,8 @@ const laravelModule: Module<Options> = function(_moduleOptions) {
256257
: [outputDir === publicDir ? 'spa.html' : 'index.html', outputDir]
257258

258259
// update nuxt router base if necessary
259-
const outputUrl = destDir.replace(publicDir, '')
260-
if (
261-
outputUrl &&
262-
(!this.options.router || this.options.router.base !== outputUrl)
263-
) {
260+
const outputUrl = `${destDir.replace(publicDir, '')}/`
261+
if (!this.options.router || this.options.router.base !== outputUrl) {
264262
this.options.router = {
265263
...(this.options.router || {}),
266264
base: outputUrl

0 commit comments

Comments
 (0)