File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/@vue/cli-service/lib/util Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -44,10 +44,14 @@ module.exports = function prepareProxy (proxy, appPublicFolder) {
4444 process . exit ( 1 )
4545 }
4646
47- // Otherwise, if proxy is specified, we will let it handle any request except for files in the public folder.
47+ // If proxy is specified, let it handle any request except for
48+ // files in the public folder and requests to the WebpackDevServer socket endpoint.
49+ // https://github.com/facebook/create-react-app/issues/6720
4850 function mayProxy ( pathname ) {
4951 const maybePublicPath = path . resolve ( appPublicFolder , pathname . slice ( 1 ) )
50- return ! fs . existsSync ( maybePublicPath )
52+ const isPublicFileRequest = fs . existsSync ( maybePublicPath )
53+ const isWdsEndpointRequest = pathname . startsWith ( '/sockjs-node' ) // used by webpackHotDevClient
54+ return ! ( isPublicFileRequest || isWdsEndpointRequest )
5155 }
5256
5357 function createProxyEntry ( target , usersOnProxyReq , context ) {
You can’t perform that action at this time.
0 commit comments