Guest User

Untitled

a guest
Dec 6th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. require('dotenv').config();
  2.  
  3. const { PHASE_PRODUCTION_SERVER } =
  4. process.env.NODE_ENV === 'development'
  5. ? {}
  6. : !process.env.NOW
  7. ? require('next/constants')
  8. : require('next-server/constants');
  9.  
  10. const config = {
  11. publicRuntimeConfig: {
  12. endpoint: process.env.ENDPOINT,
  13. username: process.env.USERNAME,
  14. password: process.env.PASSWORD
  15. }
  16. };
  17.  
  18. module.exports = (phase, { defaultConfig }) => {
  19. if (phase === PHASE_PRODUCTION_SERVER) {
  20. return config;
  21. }
  22.  
  23. const withCSS = require('@zeit/next-css');
  24.  
  25. return withCSS(config);
  26. };
Add Comment
Please, Sign In to add comment