Skip to content

Commit a93e1a1

Browse files
committed
fix(command/dev): update proxy settings after integration tests
1 parent a2ec9c6 commit a93e1a1

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

dist/subcommands/dev.js

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

src/subcommands/dev.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,15 @@ const config: NuxtLaravelCommandConfig = {
103103
const overrides: typeof options = {
104104
// use @nuxtjs/proxy module
105105
axios: {
106+
prefix: '/_laravel',
106107
proxy: true
107108
},
108109
// proxy all calls except the render path to laravel
109110
proxy: [
110111
[
111-
['**/*', `!${argv['render-path']}`],
112+
'/_laravel',
112113
{
114+
pathRewrite: { '^/_laravel': '' },
113115
target: `http://${options.server!.host}:${+options.server!
114116
.port! + 1}`
115117
}

tests/unit/subcommands/dev.spec.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ describe('nuxt laravel dev', () => {
8585
expect(options!.axios).toBeDefined()
8686
expect(options!.axios).toEqual(
8787
expect.objectContaining({
88+
prefix: '/_laravel',
8889
proxy: true
8990
})
9091
)
@@ -382,8 +383,9 @@ const proxyTest = (options: NuxtConfiguration) => {
382383
expect(options!.proxy).toEqual(
383384
expect.arrayContaining([
384385
[
385-
['**/*', `!${expected.server.path}`],
386+
'/_laravel',
386387
{
388+
pathRewrite: { '^/_laravel': '' },
387389
target: expected.laravel.url
388390
}
389391
]

0 commit comments

Comments
 (0)