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
Custom extensions with priority #3445
Comments
@timneutkens do you think this PR -> #2391 will add what I need to achieve this? |
@coluccini, so, there's one question I have, do you want this to work for |
Excellent! I don't need this to work on |
Great!
No definitive date, but I'm working on the final bits of universal webpack 👍 |
so I'll be watching you! 🤣 |
Hi!
I would like to achieve something similar to what React Native does with the
.android.js
and.ios.js
extensions. The idea is to have 2 different "extensions" and "decide" which one to use base on an env var.I've made a quick test using
create-react-app
and I achieved it by using this webpack config:Lets say that
process.env.VAR
isfoo
, if I importComponent
, webpack will first try to findComponent.foo.js
and if doesn't exist will search forComponent.js
.Is there a way to do something similar in Next? Reading a few issues I've found a
pagesExtensions
existing innext.config.js
but I'm not sure if work similar to webpack'sextensions
config…The text was updated successfully, but these errors were encountered: