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

25 lines (24 loc) 730 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addPlugin = addPlugin; const devkit_1 = require("@nx/devkit"); function addPlugin(tree) { const nxJson = (0, devkit_1.readNxJson)(tree); nxJson.plugins ??= []; for (const plugin of nxJson.plugins) { if (typeof plugin === 'string' ? plugin === '@nx/next/plugin' : plugin.plugin === '@nx/next/plugin') { return; } } nxJson.plugins.push({ plugin: '@nx/next/plugin', options: { buildTargetName: 'build', serveTargetName: 'serve', exportTargetName: 'export', }, }); (0, devkit_1.updateNxJson)(tree, nxJson); }