Skip to content

Commit

Permalink
Comment on duplicated regex
Browse files Browse the repository at this point in the history
  • Loading branch information
timacdonald committed Feb 18, 2025
1 parent 6dbbe25 commit c0c82ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ function resolveLaravelPlugin(pluginConfig: Required<PluginConfig>): LaravelPlug
origin: userConfig.server?.origin ?? 'http://__laravel_vite_placeholder__.test',
cors: userConfig.server?.cors ?? {
origin: userConfig.server?.origin ?? [
/^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/,
...(env.APP_URL ? [env.APP_URL] : []), // * (APP_URL="http://my-app.tld")
/^https?:\/\/.*\.test(:\d+)?$/, // Valet / Herd (SCHEME://*.test:PORT)
/^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/, // Copied from Vite itself. We can import this once we drop 5.0 support and require Vite 6.1+. Source: https://github.com/vitejs/vite/blob/0c854645bd17960abbe8f01b602d1a1da1a2b9fd/packages/vite/src/node/constants.ts#L200-L201
...(env.APP_URL ? [env.APP_URL] : []), // * (APP_URL="http://my-app.tld")
/^https?:\/\/.*\.test(:\d+)?$/, // Valet / Herd (SCHEME://*.test:PORT)
],
},
...(process.env.LARAVEL_SAIL ? {
Expand Down

0 comments on commit c0c82ca

Please sign in to comment.