aboutsummaryrefslogtreecommitdiff
path: root/next.config.js
blob: 05e4425c31de39d1c99f4a13f71c81f882bfdcbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const path = require('path');
const { withMarkdownLoader } = require('./plugins');

const SITE_DOMAIN = process.env.SITE_DOMAIN;

if(!SITE_DOMAIN) throw Error("Please define a display domain");

const exportDir = `export/${SITE_DOMAIN}`;

module.exports = () => {
    const plugins = [
        withMarkdownLoader,
    ];

    const webpackConfig = plugins.reduce((config, withFunc) => withFunc(config), {});

    return {
        ...webpackConfig,
        sassOptions: {
            includePaths: [path.join(__dirname, 'styles')]
        },
        env: {
          SITE_DOMAIN: SITE_DOMAIN,
        },
      output: 'export',
      distDir: exportDir,
    };
}