Skip to content

Instantly share code, notes, and snippets.

@insin
Last active July 14, 2018 13:32
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 insin/078533bae2d2e91ec94e90ff91e95593 to your computer and use it in GitHub Desktop.
Save insin/078533bae2d2e91ec94e90ff91e95593 to your computer and use it in GitHub Desktop.
babel-plugin-add-module-exports bug repro
{
"presets": [
"@babel/env",
],
"plugins": [
"add-module-exports"
]
}
{
"presets": [
["@babel/env", {loose: true}]
],
"plugins": [
"add-module-exports"
]
}
export default class Test {
}
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Test = function Test() {
_classCallCheck(this, Test);
};
exports.default = Test;
module.exports = exports.default;
"use strict";
exports.__esModule = true;
exports.default = void 0;
var Test = function Test() {};
exports.default = Test;
{
"scripts": {
"build": "babel index.js --config-file ./.babelrc-default -o out-default.js && babel index.js --config-file ./.babelrc-loose -o out-loose.js"
},
"dependencies": {
"@babel/cli": "7.0.0-beta.53",
"@babel/core": "7.0.0-beta.53",
"@babel/preset-env": "7.0.0-beta.53",
"babel-plugin-add-module-exports": "0.3.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment