forked from rescript-lang/rescript-lang.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
next.config.js
34 lines (31 loc) · 886 Bytes
/
next.config.js
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
29
30
31
32
33
34
const bsconfig = require("./bsconfig.json");
const withCSS = require("@zeit/next-css");
const withTM = require("next-transpile-modules");
const path = require('path');
const remarkSlug = require('remark-slug');
const withMdx = require("./plugins/next-mdx")({
extension: /\.mdx?$/,
options: {
remarkPlugins: [remarkSlug]
}
});
const config = {
target: "serverless",
pageExtensions: ["jsx", "js", "bs.js", "mdx"],
transpileModules: ["bs-platform"].concat(bsconfig["bs-dependencies"]),
env: {
ENV: process.env.NODE_ENV,
},
webpack: (config, options) => {
const { isServer } = options;
if (!isServer) {
// We shim fs for things like the blog slugs component
// where we need fs access in the server-side part
config.node = {
fs: 'empty'
}
}
return config
}
};
module.exports = withMdx(withTM(withCSS(config)));