We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
For zeit.co we're using a really neat babel plugin called transform-define
zeit.co
It's basically the same that webpack does, but thanks to doing it in babel, it has advantages for next:
plugins
.babelrc
package.json
package.json:
{ "dependencies": { "next": "beta", "babel-plugin-transform-define": "1.2.0" }, "babel": { "presets": [ "next/babel" ], "plugins": [ [ "transform-define", "./env-config.js" ] ] } }
env-config.js:
const prod = 'production' === process.env.NODE_ENV module.exports = { 'MY_ENV_VARIABLE': prod ? 'production' : 'development' }
pages/index.js
export default () => ( <div>Hello visitor from { MY_ENV_VARIABLE }</div> )
The text was updated successfully, but these errors were encountered:
Basically this issue is for someone to create the example for examples/env-config and submit it as a PR!
examples/env-config
Sorry, something went wrong.
timneutkens
No branches or pull requests
For
zeit.co
we're using a really neat babel plugin called transform-defineIt's basically the same that webpack does, but thanks to doing it in babel, it has advantages for next:
plugins
inside.babelrc
orpackage.json
)package.json:
env-config.js:
pages/index.js
The text was updated successfully, but these errors were encountered: