TheThingsNetwork / lorawan-stack

The Things Stack, an Open Source LoRaWAN Network Server
https://www.thethingsindustries.com/stack/
Apache License 2.0
975 stars 306 forks source link

Move babel configuration to .babelrc #66

Closed johanstokking closed 5 years ago

johanstokking commented 5 years ago

Summary: We have two babel configurations in .babelrc and package.json and should get rid of one of them

What do you see now? in package.json

  "babel": {
    "presets": [
      "env",
      "stage-0",
      "react"
    ],
    "plugins": [
      "transform-decorators-legacy",
      "transform-class-properties",
      "transform-runtime",
      [
        "react-intl-auto",
        {
          "extractComments": true,
          "filebase": true,
          "removePrefix": "pkg.webui"
        }
      ],
      [
        "react-intl",
        {
          "messagesDir": "./.cache/messages",
          "extractSourceLocation": true
        }
      ]
    ]
  },

in .babelrc

{
  "presets": [
    "env",
    "stage-0",
    "react"
  ],
  "plugins": [
    "transform-decorators-legacy",
    "transform-runtime"
  ]
}

What do you want to see instead?

A single configuration in .babelrc

How do you propose to implement this? Move the whole babel section from package.json to .babelrc

What can you do yourself and what do you need help with? Do this

cc @kschiffer


Original issue: https://github.com/TheThingsIndustries/lorawan-stack/issues/1601 by @bafonins

johanstokking commented 5 years ago

Consider this as part of #11

kschiffer commented 5 years ago

After looking at this, the .babelrc is actually in config/storybook and meant as an override for the babel configuration that storybook uses for transpilation. I tried removing the config file and it did not result in any problems. As such, I would propose to simply delete the file, instead of moving everything from package.json to a dedicated .babelrc. Any objections @bafonins ?

bafonins commented 5 years ago

I would prefer moving the whole babel related configuration into .babelrc