File tree Expand file tree Collapse file tree 4 files changed +13
-4
lines changed
packages/qwik-nx/src/plugins Expand file tree Collapse file tree 4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 11export * from './qwik-nx-vite.plugin' ;
22export type {
33 ProjectFilter ,
4+ ExcludeProjectFilter ,
45 QwikNxVitePluginOptions ,
56} from './models/qwik-nx-vite' ;
Original file line number Diff line number Diff line change @@ -7,6 +7,14 @@ export interface ProjectFilter {
77 customFilter ?: ( project : ProjectConfiguration ) => boolean ;
88}
99
10+ export interface ExcludeProjectFilter extends ProjectFilter {
11+ /**
12+ * Set to "true" to keep projects, that are not dependant on the current app according to Nx project graph.
13+ * By default only related projects are included.
14+ */
15+ keepUnrelatedProjects ?: boolean ;
16+ }
17+
1018export interface QwikNxVitePluginOptions {
1119 /**
1220 * Name of the project, with which plugin is used. By default it will be resolved using the path of the `rootDir` from the Vite environment.
@@ -20,7 +28,7 @@ export interface QwikNxVitePluginOptions {
2028 /**
2129 * Projects to be excluded from the list of resolved vendor roots.
2230 */
23- excludeProjects ?: ProjectFilter ;
31+ excludeProjects ?: ExcludeProjectFilter ;
2432 debug ?: boolean ;
2533}
2634
Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ import { getVendorRoots } from './utils/get-vendor-roots';
1010 * At this point its main purpose is to provide Nx libraries as vendor roots for the Qwik.
1111 * This is required in order for the optimizer to be able to work with entities imported from those libs.
1212 *
13- * If `options.includeProjects` is not provided, `qwikNxVite` plugin will provide Qwik with paths of Nx projects,
13+ * By default `qwikNxVite` plugin will provide Qwik with paths of Nx projects,
1414 * that are recognized as dependencies of the current one and are specified in the tsconfig.base.json.
15- * this behavior is customizable: you can exclude additional projects by providing `options.excludeProjects`
15+ * this behavior is customizable: you can exclude additional projects by providing `options.excludeProjects.keepUnrelatedProjects`,
1616 * or completely control what's included by using `options.includeProjects`
1717 */
1818export function qwikNxVite ( options ?: QwikNxVitePluginOptions ) : Plugin {
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export async function getVendorRoots(
4646
4747 projects = projects . filter ( ( p ) => p . name !== currentProjectName ) ;
4848
49- if ( ! options ?. includeProjects ) {
49+ if ( ! options ?. excludeProjects ?. keepUnrelatedProjects ) {
5050 // by default including only project dependencies
5151 const dependencies = await getProjectDependencies ( currentProjectName ) ;
5252 projects = projects . filter ( ( p ) => dependencies . has ( p . name ! ) ) ;
You can’t perform that action at this time.
0 commit comments