Skip to content

Commit ecb6541

Browse files
committed
Simple change to support more complex proxy context objects (see vuejs#2320).
(Note this also works with an array as the Object.keys.map uses array indices as the property names.)
1 parent 528c465 commit ecb6541

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/@vue/cli-service/lib/util/prepareProxy.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ module.exports = function prepareProxy (proxy, appPublicFolder) {
122122
)
123123
process.exit(1)
124124
}
125-
const entry = createProxyEntry(config.target, config.onProxyReq, context)
125+
// if the config already has a .context entry we assume they know what
126+
// they're doing and just pass the object on to the devserver proxy
127+
const entry = config.context ? {} : createProxyEntry(config.target, config.onProxyReq, context)
126128
return Object.assign({}, defaultConfig, config, entry)
127129
})
128130
}

0 commit comments

Comments
 (0)