Skip to content

Commit

Permalink
fix: watch san fail
Browse files Browse the repository at this point in the history
  • Loading branch information
kaivean committed Mar 26, 2023
1 parent 6ee498d commit af210e5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/san-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export default function (this: loader.LoaderContext, content: string) {
// 放在上面两个判断的下面,是因为 watch 编译时,不会被编译的文件可能也会走 loader
// 需要判断 san-loader 是否经过了处理,经过处理时再加入到被处理列表中
styleStore.set(this.resourcePath);
// templateStore.set内容是异步的,导致watch san文件不生效
// 因此在此同步将watch文件存起来,只是内容为空,以便 finishModules 的时候,能拿到此模板文件
templateStore.set(this.resourcePath);

const pArr = [] as Array<Promise<void>>;
templateRequireCalls.map(templateRequire => {
Expand Down

0 comments on commit af210e5

Please sign in to comment.