Skip to content

Commit

Permalink
chore: Standardise npm run start scripts
Browse files Browse the repository at this point in the history
This aligns the npm run start* scripts with other Insights front-end
applications. Also, the dev.webpack.config.js is simplified and optional
parameters are removed.
  • Loading branch information
gkarat committed Oct 31, 2023
1 parent 481c0f2 commit aa3c54b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 deletions.
21 changes: 6 additions & 15 deletions config/dev.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,18 @@ const routes = require('./routes');
const fedMods = require('./fedMods');

const hotReload = process.env.HOT_RELOAD === 'true' ? true : false;

const proxyConfiguration = {
rootFolder: resolve(__dirname, '../'),
useProxy: process.env.PROXY === 'true',
appUrl: process.env.BETA === 'true'
? ['/beta/insights/compliance', '/preview/insights/compliance']
: '/insights/compliance',
...(process.env.BETA ==='true' && { deployment: 'beta/apps' }),
env: `${process.env.INSIGHTS_ENV}-${process.env.BETA === 'true' ? 'beta' : 'stable'}`,
...(process.env.LOCAL_CHROME !== 'false' ? {
localChrome: process.env.LOCAL_CHROME_DIR || process.env.LOCAL_CHROME,
} : {}),
debug: process.env.PROXY_DEBUG === 'true',
proxyVerbose: process.env.PROXY_VERBOSE === 'true',
routes,
appUrl: process.env.BETA ? ['/beta/insights/compliance', '/preview/insights/compliance'] : ['/insights/compliance'],
deployment: process.env.BETA ? 'beta/apps' : 'apps',
env: process.env.BETA ? 'stage-beta' : 'stage-stable',
proxyVerbose: true,
debug: true
};

if(process.env.PROXY_DEBUG === 'true') {
console.log('Proxy configuration:', proxyConfiguration);
};
const { config: webpackConfig, plugins } = config(proxyConfiguration);

/**
* Use for build optimizations
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@
"coverage:clean": "rm -rf .nyc_output coverage reports",
"coverage": "bash coverage.sh && npm run coverage:clean"
}
}
}

0 comments on commit aa3c54b

Please sign in to comment.