Skip to content

Commit

Permalink
chore(commonjs): fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LarsDenBakker authored and lukastaegert committed Oct 19, 2020
1 parent d9995bb commit 2493fe4
Show file tree
Hide file tree
Showing 5 changed files with 184 additions and 372 deletions.
3 changes: 2 additions & 1 deletion packages/commonjs/src/transform.js
Expand Up @@ -784,7 +784,8 @@ export function transformCommonjs(
}
}

if (!isEsModule && !hasDefaultExport && !deconflictedDefaultExportName) {
const exportsDefault = hasDefaultExport || !!deconflictedDefaultExportName;
if (!isEsModule && !hasDefaultExport && (!isCompiledEsModule || !exportsDefault)) {
wrapperEnd = `\n\nvar ${moduleName} = {\n${names
.map(({ name, deconflicted }) => `\t${name}: ${deconflicted}`)
.join(',\n')}\n};`;
Expand Down
@@ -1,5 +1,8 @@
import * as entry from './entry.js';

t.deepEqual(entry, {
default: {
named: 'named',
},
named: 'named'
});
Expand Up @@ -3,6 +3,9 @@ import * as external from 'external-esm-named';
import * as dep from './dep';

t.deepEqual(dep, {
default: {
named: 'named'
},
named: 'named'
});

Expand Down

0 comments on commit 2493fe4

Please sign in to comment.