UNPKG

nx

Version:

The core Nx plugin contains the core functionality of Nx like the project graph, nx commands and task orchestration.

19 lines (18 loc) 751 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addViteCommandsToPackageScripts = addViteCommandsToPackageScripts; const fileutils_1 = require("../../../../utils/fileutils"); function addViteCommandsToPackageScripts(appName, isStandalone) { const packageJsonPath = isStandalone ? 'package.json' : `apps/${appName}/package.json`; const packageJson = (0, fileutils_1.readJsonFile)(packageJsonPath); packageJson.scripts = { ...packageJson.scripts, start: 'nx exec -- vite', serve: 'nx exec -- vite', build: `nx exec -- vite build`, test: 'nx exec -- vitest', }; (0, fileutils_1.writeJsonFile)(packageJsonPath, packageJson, { spaces: 2 }); }