Files
react.dev/beta/next.config.js
Rachel Nabors 981db3397e Initial check-in of new React docs and website
Co-authored-by: Dan Abramov <dan.abramov@me.com>
Co-authored-by: Sylwia Vargas <sylwia.vargas@gmail.com>
Co-authored-by: Dan Lebowitz <dan.lebo@me.com>
Co-authored-by: Razvan Gradinar <grazvan@fb.com>
Co-authored-by: Jared Palmer <jared@palmer.net>
Co-authored-by: Dane Grant <danecando@gmail.com>
Co-authored-by: Dustin Goodman <dustin.s.goodman@gmail.com>
Co-authored-by: Rick Hanlon <rickhanlonii@gmail.com>
Co-authored-by: Maggie Appleton <maggie.fm.appleton@gmail.com>
Co-authored-by: Alex Moldovan <alex.n.moldovan@gmail.com>
Co-authored-by: Ives van Hoorne <ives.v.h@gmail.com>
Co-authored-by: Brian Vaughn <bvaughn@fb.com>
Co-authored-by: Dmitri Pavlutin <dpavlutin@gmail.com>
2021-10-28 21:33:41 +01:00

52 lines
1.2 KiB
JavaScript

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*/
const path = require('path');
const {remarkPlugins} = require('./plugins/markdownToHtml');
const redirects = require('./src/redirects.json');
module.exports = {
pageExtensions: ['jsx', 'js', 'ts', 'tsx', 'mdx', 'md'],
experimental: {
plugins: true,
reactMode: 'concurrent',
scrollRestoration: true,
},
async redirects() {
return redirects.redirects;
},
env: {
// @todo Remove when https://github.com/vercel/next.js/pull/16529 lands
GA_TRACKING_ID: 'XXXX',
NEXT_PUBLIC_GA_TRACKING_ID: 'XXX',
},
rewrites() {
return [
{
source: '/feed.xml',
destination: '/_next/static/feed.xml',
},
];
},
webpack: (config, {dev, isServer, ...options}) => {
// Add our custom markdown loader in order to support frontmatter
// and layout
config.module.rules.push({
test: /.mdx?$/, // load both .md and .mdx files
use: [
options.defaultLoaders.babel,
{
loader: '@mdx-js/loader',
options: {
remarkPlugins,
},
},
path.join(__dirname, './plugins/md-layout-loader'),
],
});
return config;
},
};