loganfsmyth / babel-plugin-transform-decorators-legacy

A plugin for Babel 6 that (mostly) replicates the old decorator behavior from Babel 5
MIT License
817 stars 57 forks source link

Not playing well with other plugins #66

Open derekr opened 7 years ago

derekr commented 7 years ago

https://github.com/derekr/decorator-legacy-plugins-bug

Plugin order seems to affect other plugins, but not sure what the root cause is. Admittedly not too familiar w/ how babel plugins are run/work, but wondering if I'm overlooking something obvious.

If I run each plugin in isolation they work as expected.

Decorators work, but root-import doesn't.

{
  "presets": [
      "next/babel"
    ],
  "plugins": [
    [
      "transform-decorators-legacy",
      "babel-root-import"
    ]
  ]
}

screen shot 2017-05-25 at 11 08 21 pm

root-import works, but decorators throw syntax error

{
  "presets": [
      "next/babel"
    ],
  "plugins": [
    [
      "babel-root-import",
      "transform-decorators-legacy"
    ]
  ]
}

screen shot 2017-05-25 at 11 07 46 pm

derekr commented 7 years ago

Nevermind this is my tired eyes missing the nested array in the plugins definition -_-