-
Notifications
You must be signed in to change notification settings - Fork 116
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
webpack picks up .babelrc on netlify deploy but not locally? #152
Comments
i gotta admit the babel resolution logic might have some mismatch here vs what netlify does in production. no time to look into this right now but thank you for filing and i hope someone can dive in. this is possibly (but not definitely) the relevant code https://github.com/netlify/netlify-lambda/blob/master/lib/build.js#L18-L32 |
What kind of things do you think would be different in local vs netlify? |
For reference this issue touches on the same thing I'm up against: #34 What I'm experiencing now is that the webpack merge produces a rules config that I'm not sure will play nicely with what I'm trying to do, effectively having babel-loader configured twice? Using the config from #34 webpack.functions.js module.exports = {
externals: [nodeExternals()],
mode: 'production',
plugins: [new webpack.DefinePlugin({ 'global.GENTLY': false })],
module: {
rules: [
{
test: /\.js?$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
babelrc: false
}
}
}
]
}
} goes on to produce these rules in the final webpack config final module section in webpack config after merge: ....
"module": {
"rules": [
{
"test": {},
"exclude": {},
"use": {
"loader": "/Users/ollie/sites/netlify-lambda/node_modules/babel-loader/lib/index.js",
"options": {
"cacheDirectory": true
}
}
},
{
"test": {},
"exclude": {},
"use": {
"loader": "babel-loader",
"options": {
"babelrc": false
}
}
}
]
},
.... |
thank you @omonk 🙇🏼♂️ |
we added an option in v1.4.10 in PR #154 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Whilst trying to deploy on Netlify I get an error relating to
babel-preset-gatsby
being loaded by webpack.Makes total sense but can anyone tell me why I can't replicate this locally?
I've tried setting NODE_ENV to 'production' locally but not getting it.
webpack config:
.babelrc
any ideas?
The text was updated successfully, but these errors were encountered: