Skip to content

export default class is not working #9

@dcleao

Description

@dcleao

I am trying to compile a file with the following content:

export default class Foo {}

The output of the compilation is:

"use strict";

define(["@babel/runtime/helpers/classCallCheck"], function (_classCallCheck) {
  var Foo = function Foo() {
    _classCallCheck(this, Foo);
  };

  export { Foo as default };
});

My babel configuration is:

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "useBuiltIns": "usage",
        "debug": false,
        "corejs": 3,
        "targets": {
          "ie": "11",
          "edge": "40",
          "safari": "10",
          "firefox": "58",
          "chrome": "64"
        }
      }
    ]
  ],
  "plugins": [
    "@babel/plugin-transform-runtime",
    "babel-plugin-transform-es2015-modules-simple-amd"
  ],
  "sourceType": "module",
  "minified": false
}

And the versions of all of these, as declared in package.json are:

    "@babel/cli": "^7.6.0",
    "@babel/core": "^7.6.0",
    "@babel/plugin-transform-runtime": "^7.6.2",
    "@babel/preset-env": "^7.6.0",
    "babel-plugin-transform-es2015-modules-simple-amd": "^0.3.0",
    "core-js": "^3.2.1",

Do you know what might be causing this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions