Skip to content

Link dies silently in production, works in dev #12335

Answered by joshkadis
joshkadis asked this question in Help
Discussion options

You must be logged in to vote

Thanks!

require('dotenv').config()
const webpack = require('webpack')
const withCSS = require('@zeit/next-css');

module.exports = withCSS({
  cssModules: true,
  cssLoaderOptions: {
    modules: true,
    localIdentName: '[name]__[local]--[hash:base64:5]',
    importLoaders: 2,
  },
  webpack: (config) => {
    const define = new webpack.EnvironmentPlugin([
      'APP_DOMAIN',
      'PORT',
      'CLIENT_ID',
    ]);
    config.plugins.push(define);
    return config;
  },
});

I guess this predates built-in support for env variables.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@timneutkens
Comment options

@joshkadis
Comment options

@timneutkens
Comment options

Answer selected by joshkadis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants