Skip to content

Instantly share code, notes, and snippets.

@pkellner
Created February 15, 2019 14:11
Show Gist options
  • Save pkellner/842f952dfc917774054d209999b46a9c to your computer and use it in GitHub Desktop.
Save pkellner/842f952dfc917774054d209999b46a9c to your computer and use it in GitHub Desktop.

Revisions

  1. pkellner created this gist Feb 15, 2019.
    47 changes: 47 additions & 0 deletions next.config.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    const withCSS = require('@zeit/next-css');
    require('dotenv').config();
    const path = require('path');
    const Dotenv = require('dotenv-webpack');
    const withImages = require('next-images');
    const withTypescript = require('@zeit/next-typescript');
    const withOffline = require('next-offline');

    //const isProd = process.env.NODE_ENV === 'production';

    /* Without CSS Modules, with PostCSS */
    module.exports = withTypescript(
    withCSS(
    withImages(
    withOffline({
    //assetPrefix: isProd ? 'http://d30k733rzexkhf.cloudfront.net' : '',
    inlineImageLimit: 16384,
    serverRuntimeConfig: {
    // Will only be available on the server side
    },
    publicRuntimeConfig: {
    BASEURL_DEFAULT: 'https://www.siliconvalley-codecamp.com',
    RESTURL_SPEAKERS_DEFAULT: 'https://www.siliconvalley-codecamp.com/rest/speakers/ps',
    RESTURL_SPEAKER_DEFAULT: 'https://www.siliconvalley-codecamp.com/rest/speaker',
    RESTURL_SESSIONS_DEFAULT: 'https://www.siliconvalley-codecamp.com/rest/sessions',
    RESTURL_ISLOGGEDIN_DEFAULT: 'https://www.siliconvalley-codecamp.com/rpc/account/isLoggedInMobileApp',
    LOGINAUTH_URL_DEFAULT: 'https://www.siliconvalley-codecamp.com/rpc/account/Login',
    LOGOUT_URL_DEFAULT: 'https://www.siliconvalley-codecamp.com/rpc/account/LogOutMobileApp',
    ISLOGGEDIN_NO_DEFAULT: 'https://www.siliconvalley-codecamp.com/rpc/Account/IsLoggedIn',
    PUBLIC_URL: ''
    },
    webpack(config, options) {
    config.plugins = config.plugins || [];
    config.plugins = [
    ...config.plugins,
    // Read the .env file
    new Dotenv({
    path: path.join(__dirname, '.env'),
    systemvars: true
    })
    ];
    return config;
    }
    })
    )
    )
    );