Home / File/ next.config.js — react Source File

next.config.js — react Source File

Architecture documentation for next.config.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const path = require('path');

const nextConfig = {
  experimental: {
    reactCompiler: true,
    viewTransition: true,
  },
  reactStrictMode: true,
  webpack: (config, options) => {
    // Load *.d.ts files as strings using https://webpack.js.org/guides/asset-modules/#source-assets.
    config.module.rules.push({
      test: /\.d\.ts/,
      type: 'asset/source',
    });

    // Monaco Editor
    if (!options.isServer) {
      config.plugins.push(
        new MonacoWebpackPlugin({
          languages: ['typescript', 'javascript'],
          filename: 'static/[name].worker.js',
        })
      );
    }

    config.resolve.alias = {
      ...config.resolve.alias,
      'react-compiler-runtime': path.resolve(
        __dirname,
        '../../packages/react-compiler-runtime'
      ),
    };
    config.resolve.fallback = {
      fs: false,
      path: false,
      os: false,
    };

    return config;
  },

  transpilePackages: ['monaco-editor'],
};

module.exports = nextConfig;

Domain

Subdomains

Frequently Asked Questions

What does next.config.js do?
next.config.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Entrypoint subdomain.
What functions are defined in next.config.js?
next.config.js defines 1 function(s): nextConfig.webpack.
Where is next.config.js in the architecture?
next.config.js is located at compiler/apps/playground/next.config.js (domain: BabelCompiler, subdomain: Entrypoint, directory: compiler/apps/playground).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free