Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rn): app.config 修改后未更新 #10727

Merged
merged 2 commits into from
Nov 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/taro-rn-runner/src/config/conditional-file-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default class ConditionalFileStore<T> {
}

isEntryCache (cacheItem): boolean {
if (!cacheItem) return false
const { dependencies } = cacheItem
if (!dependencies || !dependencies.length) {
return false
Expand All @@ -24,20 +25,20 @@ export default class ConditionalFileStore<T> {
return false
}

get (key: Buffer): T | null {
const result = this._fileStore.get(key)
async get (key: Buffer): Promise<T | null> {
const result = await this._fileStore.get(key)
if (result && this.ignoreEntryFileCache && this.isEntryCache(result)) {
return null
}
return result
}

set (key: Buffer, value: any): void {
async set (key: Buffer, value: any): Promise<void> {
// fix: 样式文件不写缓存
if (value?.output?.[0]?.data?.functionMap?.names?.indexOf('ignoreStyleFileCache') > -1) {
return
}
this._fileStore.set(key, value)
return await this._fileStore.set(key, value)
}

clear (): void {
Expand Down