Skip to content

Commit

Permalink
fix(nuxt): ensure .output directory is marked as an output
Browse files Browse the repository at this point in the history
  • Loading branch information
Coly010 committed Jun 6, 2024
1 parent 3ff1b5b commit e9e7726
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/nuxt/src/plugins/__snapshots__/plugin.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ exports[`@nx/nuxt/plugin not root project should create nodes 1`] = `
},
"outputs": [
"{workspaceRoot}/dist/my-app/.nuxt",
"{projectRoot}/.output",
],
},
"acme-serve-static": {
Expand Down Expand Up @@ -57,6 +58,7 @@ exports[`@nx/nuxt/plugin not root project should create nodes 1`] = `
},
"outputs": [
"{workspaceRoot}/dist/my-app/.nuxt",
"{projectRoot}/.output",
],
},
"my-serve": {
Expand Down Expand Up @@ -97,6 +99,7 @@ exports[`@nx/nuxt/plugin root project should create nodes 1`] = `
},
"outputs": [
"dist/my-app/.nuxt",
"{projectRoot}/.output",
],
},
"build-static": {
Expand All @@ -119,6 +122,7 @@ exports[`@nx/nuxt/plugin root project should create nodes 1`] = `
},
"outputs": [
"dist/my-app/.nuxt",
"{projectRoot}/.output",
],
},
"serve": {
Expand Down
3 changes: 2 additions & 1 deletion packages/nuxt/src/plugins/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ 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 { type NuxtConfig } from '@nuxt/schema';

const cachePath = join(workspaceDataDirectory, 'nuxt.hash');
const targetsCache = readTargetsCache();
Expand Down Expand Up @@ -233,7 +234,7 @@ function getOutputs(
);

return {
buildOutputs: [buildOutputPath],
buildOutputs: [buildOutputPath, '{projectRoot}/.output'],
};
}

Expand Down

0 comments on commit e9e7726

Please sign in to comment.