Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

unable to use esm plugins unless explicitly setting babelOptions.plugins to [] #22

Open

Description

@adamburgess

if I write a module in ESM and then add it as a babel plugin, when the module gets imported it tries to transpile it using itself as a plugin ... and then jspm crashes.
should it always be necessary to override babelOptions.plugins on the module? or should plugin-babel be changed to either a) not use any babel plugins for transpiling babel plugins, or b) maybe just ignore itself

Activity

  1. guybedford commented on Feb 24, 2016

    @guybedford
    Member

    I think it would be a little too convoluted to start adding custom exceptions here. It's a very predictable failure with a very predictable fix. If publishing a plugin, I can easily opt-out of plugins in that plugin package.json package configuration:

    {
      "meta": {
        "my-plugin.js": {
          "babelOptions": {
            "plugins": []
          }
        }
      }
    }

    So I think rather to note the above as part of a plugin guide.

  2. adamburgess commented on Feb 26, 2016

    @adamburgess
    Author

    Although I agree that plugin-babel shouldn't be modified to handle this, it should at least throw an error -- currently all that is printed is:

    $ jspm build app.js
    
    Creating the single file bundle for app.js ...
    
    $
    

    which is of absolutely no help at all

  3. guybedford commented on Feb 28, 2016

    @guybedford
    Member

    Sure we can definitely include a detection. This would simply be based on a check if System.normalize(pluginName).then(function(normalizedPluginName) { normalizedPluginName == load.name }).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions