UNPKG

@nx/next

Version:

The Next.js plugin for Nx contains executors and generators for managing Next.js applications and libraries within an Nx workspace. It provides: - Scaffolding for creating, building, serving, linting, and testing Next.js applications. - Integration wit

41 lines (40 loc) 1.64 kB
/** * WARNING: Do not add development dependencies to top-level imports. * Instead, `require` them inline during the build phase. */ import type { NextConfig } from 'next'; import type { NextConfigFn } from '../src/utils/config'; import { type ProjectGraphProjectNode } from '@nx/devkit'; import type { AssetGlobPattern } from '@nx/webpack'; export interface SvgrOptions { svgo?: boolean; titleProp?: boolean; ref?: boolean; } export interface WithNxOptions extends NextConfig { nx?: { /** * @deprecated Add SVGR support in your Webpack configuration without relying on Nx. See https://react-svgr.com/docs/webpack/ * TODO(v22): Remove this option and migrate userland webpack config to explicitly configure @svgr/webpack * */ svgr?: boolean | SvgrOptions; babelUpwardRootMode?: boolean; fileReplacements?: { replace: string; with: string; }[]; assets?: AssetGlobPattern[]; }; } export interface WithNxContext { workspaceRoot: string; libsDir: string; } /** * Try to read output dir from project, and default to '.next' if executing outside of Nx (e.g. dist is added to a docker image). */ declare function withNx(_nextConfig?: WithNxOptions, context?: WithNxContext): NextConfigFn; export declare function getNextConfig(nextConfig?: WithNxOptions, context?: WithNxContext): NextConfig; export declare function getAliasForProject(node: ProjectGraphProjectNode, paths: Record<string, string[]>): null | string; export declare function forNextVersion(range: string, fn: () => void): void; export { withNx };