Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add nx option to define the dist directory of next app #293

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libs/nuxt/src/executors/server/executor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ export default async function* runExecutor(
const browserOptions = { ...rawBrowserOptions, ...overrides };

const projectRoot = await getProjectRoot(context);
const buildDir = options.buildDir || path.join(context.root, browserOptions.buildDir || '', '.nuxt')

const nuxt = await loadNuxt({
for: options.dev ? 'dev' : 'start',
rootDir: projectRoot,
configOverrides: {
buildDir: path.join(context.root, browserOptions.buildDir, '.nuxt'),
buildDir,
build: {
extend(config: Record<string, unknown>, ctx: Record<string, unknown>) {
modifyTypescriptAliases(config, projectRoot);
Expand Down
1 change: 1 addition & 0 deletions libs/nuxt/src/executors/server/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ export interface ServerExecutorSchema {
browserTarget: string;
watch: undefined;
dev: boolean;
buildDir?: string;
}
4 changes: 4 additions & 0 deletions libs/nuxt/src/executors/server/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
"type": "boolean",
"description": "Define the development or production mode of Nuxt.js.",
"default": true
},
"buildDir": {
"type": "string",
"description": "Define the dist directory for your Nuxt application"
}
},
"required": ["browserTarget"],
Expand Down