rollup / rollup-plugin-babel

This package has moved and is now available at @rollup/plugin-babel / https://github.com/rollup/plugins/tree/master/packages/babel

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How is Babel configured between its own config file and the options passed to the Rollup plugin?

mario-d-s opened this issue · comments

Hi,

I searched the issue tracker for explanation but failed to find any. To me the following is not explained properly in the readme/doc. It just says that Babel will respect any .babelrc or babel.config.js* file, but what does the final config look like?

For example, if we have in .babelrc:

"plugins": ["@babel/proposal-decorators"]

And the object returned from rollup.config.js contains this:

plugins: [
    babel({ plugins: ['@babel/proposal-class-properties'] })
]

Are the configs merged and do both plugins get applied? If yes, in what order, because that is also important?

I’m actually not sure about the order - I would assume options passed to this plugin would be put after config items, but that is a guess.

We don’t do anything special in this regard - we just hand options to Babel so it takes care of this stuff. This should be explained here https://babeljs.io/docs/en/options#merging but seems it isn’t. Maybe worth reporting to Babel?

Going to close this as the issue has been reported to Babel.