Skip to content

Commit 175962c

Browse files
authored
Fix remaining CommonJS imports after Rollup upgrade (#26473)
Follow-up to #26442. It looks like we missed a few cases where we default import a CommonJS module, which leads to Rollup adding `.default` access, e.g. `require('webpack/lib/Template').default` in the output. To fix, add the remaining cases to the list of exceptions. Verified by going through all `externals` in the bundle list, and manually checking the webpack plugin.
1 parent 3fcf209 commit 175962c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: scripts/rollup/build.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -182,12 +182,16 @@ let getRollupInteropValue = id => {
182182
// Specifying `interop: 'default'` instead will have Rollup use the imported variable as-is,
183183
// without adding a `.default` to the reference.
184184
const modulesWithCommonJsExports = [
185-
'JSResourceReferenceImpl',
186-
'error-stack-parser',
187185
'art/core/transform',
188186
'art/modes/current',
189187
'art/modes/fast-noSideEffects',
190188
'art/modes/svg',
189+
'JSResourceReferenceImpl',
190+
'error-stack-parser',
191+
'neo-async',
192+
'webpack/lib/dependencies/ModuleDependency',
193+
'webpack/lib/dependencies/NullDependency',
194+
'webpack/lib/Template',
191195
];
192196

193197
if (modulesWithCommonJsExports.includes(id)) {

0 commit comments

Comments
 (0)