Skip to content

Commit

Permalink
Avoid generate .* thing (#3034)
Browse files Browse the repository at this point in the history
* Update getExportBlock.ts

* Create _config.js

* Create main.js

* Update _config.js

* Update _config.js

* Update _config.js

* Update main.js

* Update main.js

* Update main.js
  • Loading branch information
LongTengDao authored and lukastaegert committed Aug 7, 2019
1 parent bdac4aa commit 44a23bb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/finalisers/shared/getExportBlock.ts
Expand Up @@ -27,7 +27,7 @@ export default function getExportBlock(
if (!dep.reexports) return false;
return dep.reexports.some(expt => {
if (expt.reexported === 'default') {
local = dep.namedExportsMode ? `${dep.name}.${expt.imported}` : dep.name;
local = dep.namedExportsMode && expt.imported !== '*' ? `${dep.name}.${expt.imported}` : dep.name;
return true;
}
return false;
Expand Down
9 changes: 9 additions & 0 deletions test/function/samples/avoid-exports-dot-asterisk/_config.js
@@ -0,0 +1,9 @@
module.exports = {
description: 'avoid return or set module.exports to dot-asterisk style',
options: {
external: () => true,
output: {
format: 'cjs'
}
}
};
2 changes: 2 additions & 0 deletions test/function/samples/avoid-exports-dot-asterisk/main.js
@@ -0,0 +1,2 @@
import * as path from 'path';
export { path as default };

0 comments on commit 44a23bb

Please sign in to comment.