diff --git a/scripts/webpack/utils/transformRules.js b/scripts/webpack/utils/transformRules.js index 379897709e2..ef6b4c01fc5 100644 --- a/scripts/webpack/utils/transformRules.js +++ b/scripts/webpack/utils/transformRules.js @@ -56,7 +56,9 @@ const transformRules = (projectRoot, isProd) => { loader: '@sucrase/webpack-loader', options: { production: isProd, - transforms: ['jsx', 'typescript'] + // imports is needed for applyEnvVarsToClientAssets since it uses CJS + // otherwise it gets ignored and treated as an unused export in the build + transforms: ['jsx', 'typescript', 'imports'] } } },