feat: proxy
Allowing to put a proxy field into a package.json for both app and plugin to use it with a wds build-in proxy
This commit is contained in:
@@ -14,13 +14,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { serveBundle } from '../../lib/bundler';
|
||||
import fs from 'fs-extra';
|
||||
import { Command } from 'commander';
|
||||
import { serveBundle } from '../../lib/bundler';
|
||||
import { paths } from '../../lib/paths';
|
||||
|
||||
export default async (cmd: Command) => {
|
||||
const pkgPath = paths.resolveTarget('package.json');
|
||||
const pkg = await fs.readJson(pkgPath);
|
||||
|
||||
const waitForExit = await serveBundle({
|
||||
entry: 'src/index',
|
||||
checksEnabled: cmd.check,
|
||||
proxy: pkg.proxy,
|
||||
});
|
||||
|
||||
await waitForExit();
|
||||
|
||||
@@ -14,13 +14,19 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import fs from 'fs-extra';
|
||||
import { serveBundle } from '../../lib/bundler';
|
||||
import { Command } from 'commander';
|
||||
import { paths } from '../../lib/paths';
|
||||
|
||||
export default async (cmd: Command) => {
|
||||
const pkgPath = paths.resolveTarget('package.json');
|
||||
const pkg = await fs.readJson(pkgPath);
|
||||
|
||||
const waitForExit = await serveBundle({
|
||||
entry: 'dev/index',
|
||||
checksEnabled: cmd.check,
|
||||
proxy: pkg.proxy,
|
||||
});
|
||||
|
||||
await waitForExit();
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import { BundlingPathsOptions } from './paths';
|
||||
import { ProxyConfigMap } from 'webpack-dev-server';
|
||||
|
||||
export type BundlingOptions = {
|
||||
checksEnabled: boolean;
|
||||
@@ -23,6 +24,7 @@ export type BundlingOptions = {
|
||||
|
||||
export type ServeOptions = BundlingPathsOptions & {
|
||||
checksEnabled: boolean;
|
||||
proxy?: ProxyConfigMap;
|
||||
};
|
||||
|
||||
export type BuildOptions = BundlingPathsOptions & {
|
||||
|
||||
Reference in New Issue
Block a user