Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request : Package.json Babel RC support (instead of .babelrc) #762

Closed
SilentCicero opened this issue Feb 7, 2018 · 10 comments
Closed

Comments

@SilentCicero
Copy link

SilentCicero commented Feb 7, 2018

Parcel is awesome.

I would love if I could just use the package.json to specify my .babelrc settings. Currently, that doesn't seem to be supported, and I'm forced to include an additional .babelrc file. I hate those little files. Any chance this could be an option like in webpack?

@SilentCicero
Copy link
Author

Thoughts on this?

@optimisticupdate
Copy link

On 1.5.1 configuring babel through package.json works for me. Do you have an example config which fails?

@optimisticupdate
Copy link

Ok, on 1.5.1 it works, but on current master this was removed with #559.

@sscaff1
Copy link

sscaff1 commented Feb 15, 2018

Why was this removed? How can I use babel-stage-2 or stage-0 or any other babel preset with 1.6?

@SilentCicero
Copy link
Author

SilentCicero commented Feb 15, 2018 via email

@sscaff1
Copy link

sscaff1 commented Feb 16, 2018

@SilentCicero how did you get this to work with a babelrc file? I tried the babelrc file approach and it still blew up when trying to use features that required stage-2. I went back to 1.5 and everything works.

@SilentCicero
Copy link
Author

SilentCicero commented Feb 16, 2018 via email

@sscaff1
Copy link

sscaff1 commented Feb 16, 2018

@SilentCicero yes. My project is just using stage-2 though and I'm unable to use any stage-2 features. From what I understand of the 1.6 release notes, babel-preset-env is automatic but how do I add to that?

@devongovett
Copy link
Member

Babel config in package.json should already work. See:

async function findBabelRc(asset) {
if (asset.package && asset.package.babel) {
return asset.package.babel;
}
return await asset.getConfig(['.babelrc', '.babelrc.js']);
}

@hrldcpr
Copy link

hrldcpr commented Apr 2, 2018

See #927 for an example of babel config in package.json not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants