🎥 Make videos programmatically with React
feat: add warning when override specified more than once
hunxjunedobca4b06111e5
diff --git a/packages/cli/src/config/override-webpack.ts b/packages/cli/src/config/override-webpack.tsindex a02314e93e..8aa35bc284 100644--- a/packages/cli/src/config/override-webpack.ts+++ b/packages/cli/src/config/override-webpack.ts@@ -4,6 +4,7 @@ export type WebpackOverrideFn = (currentConfiguration: WebpackConfiguration,) => WebpackConfiguration | Promise<WebpackConfiguration>;+export const defaultOverrideFunction: WebpackOverrideFn = (config) => config;let overrideFn: WebpackOverrideFn = defaultOverrideFunction;@@ -11,6 +12,15 @@ export const getWebpackOverrideFn = () => {return overrideFn;};+//to warn the user if overrideWebpackConfig is invoked more than once+let invocations = 0;+let warned = false+export const overrideWebpackConfig = (fn: WebpackOverrideFn) => {+ if(invocations > 0 && !warned){+ console.error('You specified the overrideWebpackConfig() multiple times which is incorrect, in such a case, only the function passed in the latest override will be considered. If you want to call more than one functions, pass a single function and then call other functions from inside. Read More: https://www.remotion.dev/docs/config#overridewebpackconfig https://github.com/remotion-dev/remotion/issues/4063 \n')+ warned = true+ }+ invocations++overrideFn = fn;};