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

fix(bundling): pass nxext options to our executor #13587

Merged
merged 1 commit into from Dec 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 0 additions & 5 deletions docs/generated/packages/vite.json
Expand Up @@ -224,11 +224,6 @@
"description": "Base public path when served in development or production.",
"alias": "baseHref"
},
"proxyConfig": {
"type": "string",
"description": "Path to the proxy configuration file.",
"x-completion-type": "file"
},
"configFile": {
"type": "string",
"description": "The name of the Vite.js configuration file.",
Expand Down
1 change: 0 additions & 1 deletion packages/vite/src/executors/build/schema.d.ts
Expand Up @@ -2,7 +2,6 @@ import type { FileReplacement } from '../../plugins/rollup-replace-files.plugin'
export interface ViteBuildExecutorOptions {
outputPath: string;
base?: string;
proxyConfig?: string;
configFile?: string;
fileReplacements?: FileReplacement[];
sourcemap?: boolean | 'inline' | 'hidden';
Expand Down
5 changes: 0 additions & 5 deletions packages/vite/src/executors/build/schema.json
Expand Up @@ -22,11 +22,6 @@
"description": "Base public path when served in development or production.",
"alias": "baseHref"
},
"proxyConfig": {
"type": "string",
"description": "Path to the proxy configuration file.",
"x-completion-type": "file"
},
"configFile": {
"type": "string",
"description": "The name of the Vite.js configuration file.",
Expand Down
9 changes: 9 additions & 0 deletions packages/vite/src/utils/generator-utils.ts
Expand Up @@ -138,6 +138,12 @@ export function addOrChangeBuildTarget(
};

if (targets[target]) {
buildOptions.fileReplacements = targets[target].options.fileReplacements;

if (target === '@nxext/vite:build') {
buildOptions.base = targets[target].options.baseHref;
buildOptions.sourcemap = targets[target].options.sourcemaps;
}
targets[target].options = {
...buildOptions,
};
Expand Down Expand Up @@ -179,6 +185,9 @@ export function addOrChangeServeTarget(
};

if (targets[target]) {
if (target === '@nxext/vite:dev') {
serveOptions.proxyConfig = targets[target].options.proxyConfig;
}
targets[target].options = {
...serveOptions,
};
Expand Down