Skip to content

Commit 9ec6b7f

Browse files
authored
feat(taro-platform-harmony-cpp): 支持虚拟样式 (#18253)
1 parent d1f3db8 commit 9ec6b7f

File tree

1 file changed

+4
-2
lines changed
  • packages/taro-vite-runner/src/harmony

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,10 @@ export async function stylePlugin(viteCompilerContext: ViteHarmonyCompilerContex
143143
load (id) {
144144
if (isStyleRequest(id)) {
145145
const rawId = stripVirtualModulePrefix(id).replace(STYLE_SUFFIX_RE, '')
146-
this.addWatchFile(rawId)
147-
return fs.readFileSync(rawId, 'utf-8')
146+
if (fs.existsSync(rawId)) {
147+
this.addWatchFile(rawId)
148+
return fs.readFileSync(rawId, 'utf-8')
149+
}
148150
}
149151
},
150152
async transform(raw, id) {

0 commit comments

Comments
 (0)