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

This commit is contained in:
Katerina Skroumpelou 2022-12-02 17:42:18 +02:00 committed by GitHub
parent c60d52af9b
commit d5f834a3b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 11 deletions

View File

@ -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.",

View File

@ -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';

View File

@ -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.",

View File

@ -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,
};
@ -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,
};