diff --git a/packages/rollup/src/generators/init/init.ts b/packages/rollup/src/generators/init/init.ts index 5b9563a0ddab6..f454ef9a86c4c 100644 --- a/packages/rollup/src/generators/init/init.ts +++ b/packages/rollup/src/generators/init/init.ts @@ -3,6 +3,7 @@ import { createProjectGraphAsync, formatFiles, GeneratorCallback, + readNxJson, Tree, } from '@nx/devkit'; import { nxVersion, rollupVersion } from '../../utils/versions'; @@ -12,7 +13,10 @@ import { createNodes } from '../../plugins/plugin'; export async function rollupInitGenerator(tree: Tree, schema: Schema) { let task: GeneratorCallback = () => {}; - schema.addPlugin ??= process.env.NX_ADD_PLUGINS !== 'false'; + const nxJson = readNxJson(tree); + schema.addPlugin ??= + process.env.NX_ADD_PLUGINS !== 'false' && + nxJson.useInferencePlugins !== false; if (!schema.skipPackageJson) { const devDependencies = { '@nx/rollup': nxVersion }; diff --git a/packages/vue/src/generators/application/application.ts b/packages/vue/src/generators/application/application.ts index f6efb1b7f944e..9087a6a4e143a 100644 --- a/packages/vue/src/generators/application/application.ts +++ b/packages/vue/src/generators/application/application.ts @@ -2,6 +2,7 @@ import { addProjectConfiguration, formatFiles, GeneratorCallback, + readNxJson, runTasksInSerial, toJS, Tree, @@ -28,7 +29,11 @@ export async function applicationGeneratorInternal( _options: Schema ): Promise { const options = await normalizeOptions(tree, _options); - options.addPlugin ??= process.env.NX_ADD_PLUGINS !== 'false'; + const nxJson = readNxJson(tree); + + options.addPlugin ??= + process.env.NX_ADD_PLUGINS !== 'false' && + nxJson.useInferencePlugins !== false; const tasks: GeneratorCallback[] = []; diff --git a/packages/vue/src/generators/library/lib/normalize-options.ts b/packages/vue/src/generators/library/lib/normalize-options.ts index d44605d20673a..bb2a44c5d9917 100644 --- a/packages/vue/src/generators/library/lib/normalize-options.ts +++ b/packages/vue/src/generators/library/lib/normalize-options.ts @@ -1,4 +1,10 @@ -import { getProjects, logger, normalizePath, Tree } from '@nx/devkit'; +import { + getProjects, + logger, + normalizePath, + readNxJson, + Tree, +} from '@nx/devkit'; import { determineProjectNameAndRootOptions } from '@nx/devkit/src/generators/project-name-and-root-utils'; import { NormalizedSchema, Schema } from '../schema'; @@ -36,9 +42,14 @@ export async function normalizeOptions( bundler = 'vite'; } } + const nxJson = readNxJson(host); + + const addPlugin = + process.env.NX_ADD_PLUGINS !== 'false' && + nxJson.useInferencePlugins !== false; const normalized = { - addPlugin: process.env.NX_ADD_PLUGINS !== 'false', + addPlugin, ...options, bundler, fileName,