Skip to content

Instantly share code, notes, and snippets.

@remy
Created July 18, 2018 20:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save remy/0092039d97c2e2677af09928f378cd1f to your computer and use it in GitHub Desktop.
Save remy/0092039d97c2e2677af09928f378cd1f to your computer and use it in GitHub Desktop.
How I get env values into next.js
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