File tree 1 file changed +6
-5
lines changed
packages/uni-cli-shared/src/vite/plugins/uts
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -455,19 +455,20 @@ export function uniUTSAppUniModulesPlugin(
455
455
if ( deps . length ) {
456
456
for ( const dep of deps ) {
457
457
if ( dep ) {
458
- // 本次编译流程中已编译过该插件,直接使用缓存
459
458
const depPluginDir = normalizePath ( path . resolve ( uniModulesDir , dep ) )
459
+ // 本次编译流程中已编译过该插件,直接使用缓存
460
460
if ( utsModuleCaches . get ( depPluginDir ) ) {
461
461
await utsModuleCaches . get ( depPluginDir ) ! ( ) . then ( ( result ) => {
462
462
if ( result ) {
463
463
handleCompileResult ( result , pluginContext )
464
464
}
465
465
} )
466
466
} else {
467
- await compilePlugin (
468
- path . resolve ( inputDir , 'uni_modules' , dep ) ,
469
- pluginContext
470
- ) . then ( ( result ) => {
467
+ const compile = once ( ( ) => {
468
+ return compilePlugin ( depPluginDir , pluginContext )
469
+ } )
470
+ utsModuleCaches . set ( depPluginDir , compile )
471
+ await compile ( ) . then ( ( result ) => {
471
472
if ( result ) {
472
473
handleCompileResult ( result , pluginContext )
473
474
}
You can’t perform that action at this time.
0 commit comments