Skip to content

Instantly share code, notes, and snippets.

@deepak
Created February 5, 2015 08:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deepak/6befe1fc338bbd5db353 to your computer and use it in GitHub Desktop.
Save deepak/6befe1fc338bbd5db353 to your computer and use it in GitHub Desktop.
where is the exports variable defined ?
export {Worker} from './package';
"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 ?
export class Worker {
constructor(name) {
this._name = name;
}
get name() {
return this._name;
}
doWork() {
return `${this.name} is working`;
}
}
"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
@deepak
Copy link
Author

deepak commented Feb 5, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment