mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2025-12-30 11:22:31 +00:00
feat(build,config) disable config whitelist in dev mode
Webpack will replace the code so the added condition because `if (true)` in dev mode, which helps when one wants to override anything for testing.
This commit is contained in:
committed by
Saúl Ibarra Corretgé
parent
26423f8e76
commit
7f601db349
@@ -193,6 +193,13 @@ export function overrideConfigJSON(config: IConfig, interfaceConfig: any, json:
|
||||
* that are whitelisted.
|
||||
*/
|
||||
export function getWhitelistedJSON(configName: 'interfaceConfig' | 'config', configJSON: any): Object {
|
||||
// Disable whitelisting in dev mode.
|
||||
if (typeof __DEV__ !== 'undefined' && __DEV__) {
|
||||
logger.warn('Whitelisting is disabled in dev mode, accepting any overrides');
|
||||
|
||||
return configJSON;
|
||||
}
|
||||
|
||||
if (configName === 'interfaceConfig') {
|
||||
return pick(configJSON, INTERFACE_CONFIG_WHITELIST);
|
||||
} else if (configName === 'config') {
|
||||
|
||||
@@ -288,6 +288,9 @@ module.exports = (_env, argv) => {
|
||||
plugins: [
|
||||
...config.plugins,
|
||||
...getBundleAnalyzerPlugin(analyzeBundle, 'app'),
|
||||
new webpack.DefinePlugin({
|
||||
'__DEV__': !isProduction
|
||||
}),
|
||||
new webpack.IgnorePlugin({
|
||||
resourceRegExp: /^canvas$/,
|
||||
contextRegExp: /resemblejs$/
|
||||
|
||||
Reference in New Issue
Block a user