Skip to content

Commit 0500436

Browse files
author
zhutianjian3
committed
feat(vite): fix harmony pipeline
1 parent 97c6ab6 commit 0500436

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

packages/taro-vite-runner/src/harmony/pipeline.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { VITE_COMPILER_LABEL } from '@tarojs/runner-utils'
22
import { isFunction } from '@tarojs/shared'
33

4+
import { getMode } from '../utils'
5+
46
import type { ViteHarmonyCompilerContext } from '@tarojs/taro/types/compile/viteCompilerContext'
57
import 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 }

0 commit comments

Comments
 (0)