Skip to content

Commit

Permalink
feat: make fec build compatible with monorepo setups
Browse files Browse the repository at this point in the history
A followup of RedHatInsights#1667
  • Loading branch information
riccardo-forina committed Jan 13, 2023
1 parent d6ced16 commit 4711c18
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions packages/config/src/scripts/build-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@ const { spawn } = require('child_process');

function buildScript(argv, cwd) {
validateFECConfig(cwd);
const processArgs = [];
let configPath;
if (typeof argv.webpackConfig !== 'undefined') {
configPath = getWebpackConfigPath(argv.webpackConfig, cwd);
} else {
configPath = resolve(__dirname, './prod.webpack.config.js');
}
processArgs.push(`node_modules/.bin/webpack -c ${configPath}`);
process.env.NODE_ENV = 'production';
const subprocess = spawn('node', processArgs, {
const subprocess = spawn(`npm exec -- webpack -c ${configPath}`, [], {
stdio: [process.stdout, process.stdout, process.stdout],
cwd,
shell: true,
Expand Down
3 changes: 1 addition & 2 deletions packages/config/src/scripts/dev-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,14 @@ async function devScript(argv, cwd) {
validateFECConfig(cwd);

const fecConfig = require(process.env.FEC_CONFIG_PATH);
const processArgs = [];
let configPath;
if (typeof argv.webpackConfig !== 'undefined') {
configPath = getWebpackConfigPath(argv.webpackConfig, cwd);
} else {
configPath = resolve(__dirname, './dev.webpack.config.js');
}
await setEnv(cwd);
spawn(`npm exec -- webpack serve -c ${configPath}`, processArgs, {
spawn(`npm exec -- webpack serve -c ${configPath}`, [], {
stdio: [process.stdout, process.stdout, process.stdout],
cwd,
shell: true,
Expand Down

0 comments on commit 4711c18

Please sign in to comment.