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

prefer babelrc defined node version target over pkg json engines field when --target node #2366

Open
jthegedus opened this issue Dec 6, 2018 · 0 comments

Comments

@jthegedus
Copy link

jthegedus commented Dec 6, 2018

🙋 feature request

When using --target node still prefer reading the node target from .babelrc if present.

🤔 Expected Behavior

if a .babelrc file is present and I use --target node I would like my explicit babel preset-env node version to be the target.

😯 Current Behavior

Currently, if --target node is found then the engines field is automatically used regardless of .babelrc
the parceljs code

💁 Possible Solution

when --target node prefer .babelrc over node engines field value.

🔦 Context

Firebase uses the engines field to specify the runtime for their Cloud Functions. They only support two specific numbers here, no semver ranges. Just

"engines": "6"
"engines": "8"

This causes issues when I want to dev in Node 10 with Yarn because the engines field does is not using a range, so I get an incompat node version error.

If it is omitted, then Node 6 is targetted, which would be fine, except that Parcel defaults to Node 8.

I asked to add range support to firebase which would solve the issue, but it does not seem like they will be addressing this on their end anytime soon.

If I could tell Parcel to target Node 6 via .babelrc then I could leave off the engines field and Firebase would target Node 6 and I could dev with Node 10 LTS & Yarn

I'm unsure what implications this could have on existing projects.

💻 Examples

@jthegedus jthegedus changed the title prefer babelrc defined node version target of engines field when --target node prefer babelrc defined node version target over engines field when --target node Dec 6, 2018
@jthegedus jthegedus changed the title prefer babelrc defined node version target over engines field when --target node prefer babelrc defined node version target over pkg json engines field when --target node Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants