Skip to content

Commit

Permalink
fix devserver env vars not setting
Browse files Browse the repository at this point in the history
  • Loading branch information
dilanx committed Oct 27, 2022
1 parent 3785fbe commit fa09aa8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ function createProxy(
);
}

setEnvironmentVariables(devServerConfig);

devServerConfig = applyDevServerConfigPlugins(
cracoConfig,
devServerConfig,
Expand Down
6 changes: 6 additions & 0 deletions packages/craco/src/lib/features/dev-server/override.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
import type { CracoConfig, DevServerContext } from '@craco/types';

import { overrideDevServerConfigProvider } from '../../cra';
import { isFunction } from '../../utils';
import { createConfigProviderProxy } from './create-config-provider-proxy';
import { overrideDevServerUtils } from './override-utils';
import { setEnvironmentVariables } from './set-environment-variables';

export function overrideDevServer(
cracoConfig: CracoConfig,
context: DevServerContext
) {
overrideDevServerUtils(cracoConfig);

if (cracoConfig.devServer && !isFunction(cracoConfig.devServer)) {
setEnvironmentVariables(cracoConfig.devServer);
}

const proxy = createConfigProviderProxy(cracoConfig, context);
overrideDevServerConfigProvider(cracoConfig, proxy);
}

0 comments on commit fa09aa8

Please sign in to comment.