Created
February 5, 2015 08:04
-
-
Save deepak/6befe1fc338bbd5db353 to your computer and use it in GitHub Desktop.
where is the exports variable defined ?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export {Worker} from './package'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
exports.Worker = require("./package").Worker; | |
exports.__esModule = true; | |
// where is exports defined by 6to5 ? | |
// and no included method for require ? | |
// what is `__esModule` ? what is it used for ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class Worker { | |
constructor(name) { | |
this._name = name; | |
} | |
get name() { | |
return this._name; | |
} | |
doWork() { | |
return `${this.name} is working`; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use strict"; | |
var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); }; | |
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; | |
var Worker = exports.Worker = (function () { | |
function Worker(name) { | |
_classCallCheck(this, Worker); | |
this._name = name; | |
} | |
_prototypeProperties(Worker, null, { | |
name: { | |
get: function () { | |
return this._name; | |
}, | |
configurable: true | |
}, | |
doWork: { | |
value: function doWork() { | |
return "" + this.name + " is working"; | |
}, | |
writable: true, | |
configurable: true | |
} | |
}); | |
return Worker; | |
})(); | |
exports.__esModule = true; | |
// output | |
// Can't find variable: exports |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
modules are not shown in http://kangax.github.io/compat-table/es6 yet
see compat-table/compat-table#316