Skip to content

Instantly share code, notes, and snippets.

@jthegedus
Last active April 3, 2018 12:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jthegedus/645c3103ddd81cbc3c4c1d98ba721cce to your computer and use it in GitHub Desktop.
Save jthegedus/645c3103ddd81cbc3c4c1d98ba721cce to your computer and use it in GitHub Desktop.
next.js plugin
const nextEnv = require('next-env');
const nextEnvOpts = { ... };
module.exports = (phase, {defaultConfig}) => {
return nextEnv(nextEnvOpts, defaultConfig, phase); // explicitly pass phase
}
/// with other plugins
const withTypescript = require('@zeit/next-typescript')
module.exports = (phase, {defaultConfig}) => {
return withTypescript(nextEnv(nextEnvOpts, defaultConfig, phase)); // explicitly pass phase
}
const nextEnv = require('next-env');
const nextEnvOpts = { ... };
const withNextEnv = nextEnv(nextEnvOpts);
module.exports = withNextEnv({ // is phase implicitly passed?
... // default config
})
/// with other plugins
const withTypescript = require('@zeit/next-typescript')
module.exports = withTypescript(nextEnv(nextEnvOpts, { ... } )); // is phase implicitly passed?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment