Skip to content

Commit

Permalink
fix(nuxt): use loadConfigFile from devkit rather than @nuxt/kit
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysoo committed Mar 28, 2024
1 parent 4b75255 commit 3480c2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion e2e/nuxt/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"targets": {
"e2e": {}
},
"implicitDependencies": ["nuxt"]
"implicitDependencies": ["nuxt", "vite"]
}
12 changes: 4 additions & 8 deletions packages/nuxt/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import { basename, dirname, isAbsolute, join, relative } from 'path';
import { projectGraphCacheDirectory } from 'nx/src/utils/cache-directory';
import { getNamedInputs } from '@nx/devkit/src/utils/get-named-inputs';
import { existsSync, readdirSync } from 'fs';
import { loadNuxtKitDynamicImport } from '../utils/executor-utils';
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';

const cachePath = join(projectGraphCacheDirectory, 'nuxt.hash');
const targetsCache = existsSync(cachePath) ? readTargetsCache() : {};
Expand Down Expand Up @@ -208,13 +208,9 @@ async function getInfoFromNuxtConfig(
): Promise<{
buildDir: string;
}> {
const { loadNuxtConfig } = await loadNuxtKitDynamicImport();

const config = await loadNuxtConfig({
cwd: joinPathFragments(context.workspaceRoot, projectRoot),
configFile: basename(configFilePath),
});

const config = await loadConfigFile(
join(context.workspaceRoot, configFilePath)
);
return {
buildDir: config?.buildDir,
};
Expand Down

0 comments on commit 3480c2c

Please sign in to comment.