babel / babel-brunch

Brunch plugin for Babel
ISC License
68 stars 38 forks source link

Use options defined in the .babelrc file #41

Closed ryansobol closed 7 years ago

ryansobol commented 8 years ago

It would be pretty sweet if the babel-brunch plugin could use the options defined in the .babelrc file, if it exists. Something like this should work.

JSON.parse(fs.readFileSync(path.join(__dirname, '.babelrc'), 'utf8'));

I haven't thought much about the load order of using .babelrc options vs brunch-config.js options. I'll let smarter people who have stronger opinions worry about that.

paulmillr commented 8 years ago

yep

rafaelkallis commented 7 years ago

Dunno why this hasn't been mentioned yet, but it is possible. Issue can be closed IMO

add this in your brunch-config.js:

plugins: {
    babel: {
        babelrc: true
    }
}

EDIT: it seems the babelrc option is true by default, so it's not even necessary to set that option

denysdovhan commented 7 years ago

Could be closed.

babel-brunch uses options from .babelrc as default.

denysdovhan commented 7 years ago

UPD: Confirmed. Related to babel/babel-brunch#52.

When we specify options only in .babelrc, then these lines add ['es2016', 'es2016'] presets. Options passed to babel.transform() have more priority, so settings from .babelrc are ignored.

denysdovhan commented 7 years ago

Should be fixed by #53.

denysdovhan commented 7 years ago

53 has been merged. This issue is resolved.