Skip to content

Commit c111c6a

Browse files
authored
Merge pull request #2202 from rawagner/bin_monorepo
fix: make webpack/http-server bin lookup compatible with monorepo setup
2 parents 542d35f + d410200 commit c111c6a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/config-utils/src/serve-federated.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import { LogType, fecLogger } from '.';
77

88
function federate(argv: Record<string, any>, cwd: string) {
99
let configPath: string = argv.config || './node_modules/@redhat-cloud-services/frontend-components-config/bin/prod.webpack.config.js';
10-
const WEBPACK_PATH = path.resolve(cwd, './node_modules/.bin/webpack');
11-
const HTTP_SERVER_PATH = path.resolve(cwd, './node_modules/.bin/http-server');
1210
if (typeof configPath !== 'string') {
1311
console.error('Invalid webpack config path!');
1412
process.exit(1);
@@ -53,8 +51,8 @@ function federate(argv: Record<string, any>, cwd: string) {
5351
const outputPath = config.output.path;
5452

5553
concurrently([
56-
`${WEBPACK_PATH} --config ${configPath} --watch --output-path ${path.join(outputPath, cdnPath)}`,
57-
`${HTTP_SERVER_PATH} ${outputPath} -p ${argv.port || 8003} -c-1 -a :: --cors=*`,
54+
`npm exec -- webpack --config ${configPath} --watch --output-path ${path.join(outputPath, cdnPath)}`,
55+
`npm exec -- http-server ${outputPath} -p ${argv.port || 8003} -c-1 -a :: --cors=*`,
5856
]);
5957
});
6058
} catch (error) {

0 commit comments

Comments
 (0)