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

Add flag to not use relative .babelrc config #154

Merged
merged 3 commits into from
May 18, 2019

Conversation

omonk
Copy link
Contributor

@omonk omonk commented May 17, 2019

Based upon this issue #152

I'm not sure how this package is tested locally but my process was:

yarn add babel-preset-gatsby

add a .babelrc in the root

{
  "presets": ["babel-preset-gatsby"],
}

add functions/handle.js file with basic lambda

exports.handler = async () => {
  return {
    statusCode: 200,
    body: 'yay'
  }
}

add netlify.toml

[build]
  functions = "./output"

to have the command error run: bin/cmd.js build functions/

You should get and error that looks something along the lines of this:

`babel-preset-gatsby` has been loaded, which consumes config generated by the Gatsby CLI.

to have the command pass run: bin/cmd.js build --babelrc false functions/

Can't you just set this babelrc: false opt in a custom webpack config?

I tried that but found that the webpackmerge library doesn't dedupe the two babel-loader rules so you end up with two babel-loader configs, one of which includes the root .babelrc

@omonk omonk changed the title Add flag to no use relative .babelrc config Add flag to not use relative .babelrc config May 17, 2019
@swyxio
Copy link
Contributor

swyxio commented May 18, 2019

good enough for me. i still feel like we havent really addressed the issue of the mismatch between netlify lambda and the real deployment environment.

@swyxio swyxio merged commit 86332fb into netlify:master May 18, 2019
@swyxio
Copy link
Contributor

swyxio commented May 18, 2019

v1.4.10

@omonk
Copy link
Contributor Author

omonk commented May 18, 2019

@sw-yx what kind of differences do you have in mind? My build step in netlify is to run gatsby build and netlify-lambda build in parallel. This PR should help me with the issues I've been experiencing but happy to help out if you can shed any light into the netlify production environment and how you'd like to align!

@swyxio
Copy link
Contributor

swyxio commented May 18, 2019

i have no idea to be honest. i will just keep this in mind for now and come back to it when i figure out what it is. sorry i dont have a better answer.

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

Successfully merging this pull request may close these issues.

2 participants