2019-11-06 18:20:09 +04:00
|
|
|
const path = require('path');
|
2019-08-24 18:34:46 +04:00
|
|
|
const withSass = require('@zeit/next-sass');
|
2019-09-04 15:27:00 +04:00
|
|
|
const withCSS = require('@zeit/next-css');
|
2019-11-06 18:20:09 +04:00
|
|
|
const rehypePrism = require('@mapbox/rehype-prism');
|
2019-11-06 21:37:16 +04:00
|
|
|
const {
|
|
|
|
getPageRoutes,
|
|
|
|
getGuideRoutes,
|
|
|
|
getRoadmapRoutes,
|
|
|
|
} = require("./path-map");
|
2019-08-24 18:34:46 +04:00
|
|
|
|
2019-11-01 09:28:05 +04:00
|
|
|
const withMDX = require('@next/mdx')({
|
|
|
|
extension: /\.(md|mdx)?$/,
|
|
|
|
options: {
|
|
|
|
rehypePlugins: [rehypePrism],
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
const options = {
|
2019-10-18 23:40:37 +04:00
|
|
|
exportPathMap: () => {
|
|
|
|
return {
|
2019-11-06 21:37:16 +04:00
|
|
|
...getPageRoutes(),
|
|
|
|
...getGuideRoutes(),
|
|
|
|
...getRoadmapRoutes(),
|
2019-10-18 23:40:37 +04:00
|
|
|
};
|
|
|
|
},
|
|
|
|
|
2019-11-01 09:28:05 +04:00
|
|
|
// Allow mdx and md files to be pages
|
|
|
|
pageExtensions: ['jsx', 'js', 'mdx', 'md'],
|
|
|
|
|
2019-09-04 16:32:25 +04:00
|
|
|
webpack(config, options) {
|
2019-11-02 12:45:15 +04:00
|
|
|
// // Transforms SVGs to components
|
2019-09-04 16:32:25 +04:00
|
|
|
config.module.rules.push({
|
2019-11-02 12:45:15 +04:00
|
|
|
test: /\.svg$/,
|
|
|
|
use: ['@svgr/webpack'],
|
|
|
|
});
|
|
|
|
|
2019-11-06 18:20:09 +04:00
|
|
|
config.resolve.modules.push(path.resolve('./'));
|
|
|
|
|
2019-11-02 12:45:15 +04:00
|
|
|
// Allow loading images
|
|
|
|
config.module.rules.push({
|
|
|
|
test: /\.(png|jpg|gif|eot|ttf|woff|woff2)$/,
|
2019-09-04 16:32:25 +04:00
|
|
|
use: {
|
|
|
|
loader: 'url-loader',
|
|
|
|
options: {
|
|
|
|
limit: 100000,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
return config
|
|
|
|
},
|
2019-11-01 09:28:05 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
let nextConfig = withSass(options);
|
|
|
|
nextConfig = withCSS(nextConfig);
|
|
|
|
nextConfig = withMDX(nextConfig);
|
|
|
|
|
2019-11-06 18:20:09 +04:00
|
|
|
module.exports = nextConfig;
|