Skip to content
Snippets Groups Projects
Select Git revision
  • aa156d0246238b29e0d0005d0c09f305c50ec2ec
  • master default protected
  • maj-readme
  • update-budget-msg-2022
  • share-with-metadata
  • explications-resultats-macros-PLF2022
  • plf_fix
  • benoit-cty-master-patch-87290
  • activate-plf-2021
  • stats
  • switch-plf
  • carto
  • adapt-matomo
  • js-to-ts
  • nbre-part-logic
  • add-nbre-part
  • 1.0.0
17 results

next.config.js

  • next.config.js 751 B
    const env = process.env.NODE_ENV
    const withSass = require("@zeit/next-sass")
    const DotenvPlugin = require("dotenv-webpack")
    const { EnvironmentPlugin } = require("webpack") // eslint-disable-line import/no-extraneous-dependencies
    const { assign, concat } = require("lodash/fp")
    
    function envPlugin() {
        if (env === "production") {
            return new EnvironmentPlugin(process.env)
        }
    
        return new DotenvPlugin()
    }
    
    const nextConfig = {
        exportPathMap() {
            return {
                "/": { page: "/" },
            }
        },
        webpack(webpackConfig) {
            const plugins = concat(webpackConfig.plugins, [envPlugin()])
            return assign(webpackConfig, { plugins })
        },
        distDir: "build",
    }
    
    module.exports = withSass(nextConfig)