File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/taro-vite-runner/src/harmony Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 11import { VITE_COMPILER_LABEL } from '@tarojs/runner-utils'
22import { isFunction } from '@tarojs/shared'
33
4+ import { getMode } from '../utils'
5+
46import type { ViteHarmonyCompilerContext } from '@tarojs/taro/types/compile/viteCompilerContext'
57import type { PluginOption } from 'vite'
68
@@ -9,8 +11,11 @@ export default function (viteCompilerContext: ViteHarmonyCompilerContext): Plugi
911 return {
1012 name : 'taro:vite-harmony-pipeline' ,
1113 enforce : 'pre' ,
12- buildStart ( ) {
13- this . load ( { id : VITE_COMPILER_LABEL } )
14+ async buildStart ( ) {
15+ const isProd = getMode ( taroConfig ) === 'production'
16+ isProd
17+ ? this . load ( { id : VITE_COMPILER_LABEL } )
18+ : await this . load ( { id : VITE_COMPILER_LABEL } )
1419 const info = this . getModuleInfo ( VITE_COMPILER_LABEL )
1520 if ( info ) {
1621 info . meta = { viteCompilerContext }
You can’t perform that action at this time.
0 commit comments