Created
July 18, 2018 20:40
-
-
Save remy/0092039d97c2e2677af09928f378cd1f to your computer and use it in GitHub Desktop.
How I get env values into next.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('@remy/envy'); // similar to dotenv, but supports .env.production, .env.local, etc | |
const webpack = require('webpack'); | |
module.exports = { | |
webpack: config => { | |
config.plugins.push( | |
new webpack.EnvironmentPlugin( | |
['SHOW_SPEAKER'] // array of indiviudal ENV values I want exposed | |
) | |
); | |
return config; | |
}, | |
}; | |
// from https://next.training.leftlogic.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment