Merge pull request #908 from shmidt-i/feat/proxy
Use proxy package.json field for app:serve and plugin:serve
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import yn from 'yn';
|
||||
import webpack from 'webpack';
|
||||
import WebpackDevServer from 'webpack-dev-server';
|
||||
@@ -36,6 +37,8 @@ export async function serveBundle(options: ServeOptions) {
|
||||
const urls = prepareUrls(protocol, host, port);
|
||||
|
||||
const paths = resolveBundlingPaths(options);
|
||||
const pkgPath = paths.targetPackageJson;
|
||||
const pkg = await fs.readJson(pkgPath);
|
||||
const config = createConfig(paths, { ...options, isDev: true });
|
||||
const compiler = webpack(config);
|
||||
|
||||
@@ -48,6 +51,7 @@ export async function serveBundle(options: ServeOptions) {
|
||||
https: protocol === 'https',
|
||||
host,
|
||||
port,
|
||||
proxy: pkg.proxy,
|
||||
});
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
|
||||
Reference in New Issue
Block a user