Skip to content

Uncaught ReferenceError: module is not defined When directly used in Browser. #80

@MinimalistYing

Description

@MinimalistYing

I have an library use babel 7 and @babel/plugin-transform-modules-umd to transform ES6 Modules into UMD.
And now i want to use this library to remove the ugly use of default.
I use babel-plugin-add-module-exports v1.0.2 in my project.
But the output code ended with

// ......
  var _default = new Message();

  _exports.default = _default;
  module.exports = exports.default;

When the output code running in browser, this Error comes out

Uncaught ReferenceError: module is not defined

I found a closed issue don't handle an amd module #57 here.
It seems i have the same issue in version 1.0.2

How can i solve this problem ? Thanks.

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