Skip to content

Commit c0c82ca

Browse files
committed
Comment on duplicated regex
1 parent 6dbbe25 commit c0c82ca

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,9 @@ function resolveLaravelPlugin(pluginConfig: Required<PluginConfig>): LaravelPlug
154154
origin: userConfig.server?.origin ?? 'http://__laravel_vite_placeholder__.test',
155155
cors: userConfig.server?.cors ?? {
156156
origin: userConfig.server?.origin ?? [
157-
/^https?:\/\/(?:(?:[^:]+\.)?localhost|127\.0\.0\.1|\[::1\])(?::\d+)?$/,
158-
...(env.APP_URL ? [env.APP_URL] : []), // * (APP_URL="http://my-app.tld")
159-
/^https?:\/\/.*\.test(:\d+)?$/, // Valet / Herd (SCHEME://*.test:PORT)
157+
/^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
158+
...(env.APP_URL ? [env.APP_URL] : []), // * (APP_URL="http://my-app.tld")
159+
/^https?:\/\/.*\.test(:\d+)?$/, // Valet / Herd (SCHEME://*.test:PORT)
160160
],
161161
},
162162
...(process.env.LARAVEL_SAIL ? {

0 commit comments

Comments
 (0)