File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed
libs/nx-angular-mf/src/builders/custom-loader Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
import { Context , DefaultLoad , NextResolve } from './types' ;
2
-
2
+ import { join } from 'path' ;
3
3
4
4
export async function initialize ( { port } : { port : MessagePort } ) {
5
5
port . onmessage = async ( event ) => { } ;
6
6
}
7
7
8
8
export async function resolve (
9
- specifierInput : string ,
9
+ specifier : string ,
10
10
context : Context ,
11
11
nextResolve : NextResolve
12
12
) {
13
- nextResolve ( specifierInput , context , nextResolve ) ;
13
+ const { parentURL } = context ;
14
+ if (
15
+ specifier . startsWith ( 'vite' ) &&
16
+ parentURL . indexOf ( '@angular/build' ) > - 1
17
+ ) {
18
+ return nextResolve (
19
+ join ( __dirname , 'patch-vite-dev-server.js' ) ,
20
+ context ,
21
+ nextResolve
22
+ ) ;
23
+ }
24
+
25
+ return nextResolve ( specifier , context , nextResolve ) ;
14
26
}
15
27
16
28
export async function load (
You can’t perform that action at this time.
0 commit comments