aboutsummaryrefslogtreecommitdiff
path: root/next.config.js
blob: 0d49eb4a6dfa88fd6aabd7038a1d09e3ca5ddaf2 (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 DISPLAY_DOMAIN = process.env.DISPLAY_DOMAIN;

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

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

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

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

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