set passModuleArg when handling default export specifiers in amd module formatter - fixes #1260

This commit is contained in:
Sebastian McKenzie 2015-04-14 07:39:34 -07:00
parent 35af771a29
commit 47d253c732
3 changed files with 9 additions and 0 deletions

View File

@ -105,6 +105,7 @@ export default class AMDFormatter extends DefaultFormatter {
exportSpecifier(specifier, node, nodes) { exportSpecifier(specifier, node, nodes) {
if (this.doDefaultExportInterop(specifier)) { if (this.doDefaultExportInterop(specifier)) {
this.passModuleArg = true;
nodes.push(util.template("exports-default-assign", { nodes.push(util.template("exports-default-assign", {
VALUE: specifier.local VALUE: specifier.local
}, true)); }, true));

View File

@ -0,0 +1,2 @@
var a = 1;
export { a as default };

View File

@ -0,0 +1,6 @@
define(["exports", "module"], function (exports, module) {
"use strict";
var a = 1;
module.exports = a;
});