Skip to content

Commit

Permalink
fix(nuxt): use loadNuxtConfig to load nuxt config for plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Coly010 committed Nov 5, 2024
1 parent e2f5eaa commit eb1e2cd
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/nuxt/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { getNamedInputs } from '@nx/devkit/src/utils/get-named-inputs';
import { existsSync, readdirSync } from 'fs';
import { calculateHashForCreateNodes } from '@nx/devkit/src/utils/calculate-hash-for-create-nodes';
import { getLockFileName } from '@nx/js';
import { loadConfigFile } from '@nx/devkit/src/utils/config-utils';
import { loadNuxtKitDynamicImport } from '../utils/executor-utils';

const cachePath = join(workspaceDataDirectory, 'nuxt.hash');
const targetsCache = readTargetsCache();
Expand Down Expand Up @@ -208,10 +208,11 @@ async function getInfoFromNuxtConfig(
): Promise<{
buildDir: string;
}> {
// TODO(Colum): Once plugins are isolated we can go back to @nuxt/kit since each plugin will be run in its own worker.
const config = await loadConfigFile(
join(context.workspaceRoot, configFilePath)
);
const config = await (
await loadNuxtKitDynamicImport()
).loadNuxtConfig({
configFile: configFilePath,
});
return {
buildDir:
config?.buildDir ??
Expand Down

0 comments on commit eb1e2cd

Please sign in to comment.