@nx/next
Version:
25 lines (24 loc) • 730 B
JavaScript
;
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);
}