fix non-devserver build

This commit is contained in:
Vivian Lim 2020-07-19 20:03:08 -07:00
parent 5b63ee4f37
commit a2853c4a95
1 changed files with 11 additions and 9 deletions

View File

@ -30,16 +30,18 @@ export default {
config.resolve.alias["react"] = "preact/compat";
config.resolve.alias["react-dom"] = "preact/compat";
config.devServer.proxy = [{
// proxy requests matching a pattern:
path: '/api/**',
if (config.devServer){
config.devServer.proxy = [{
// proxy requests matching a pattern:
path: '/api/**',
// where to proxy to:
target: 'http://localhost:8000',
// where to proxy to:
target: 'http://localhost:8000',
// optionally change Origin: and Host: headers to match target:
changeOrigin: true,
changeHost: true,
}];
// optionally change Origin: and Host: headers to match target:
changeOrigin: true,
changeHost: true,
}];
}
}
};