Skip to content

fix: css cache check#262

Merged
yyx990803 merged 2 commits into
masterfrom
css-used-check
May 26, 2020
Merged

fix: css cache check#262
yyx990803 merged 2 commits into
masterfrom
css-used-check

Conversation

@underfin
Copy link
Copy Markdown
Member

No description provided.

`${basename(file)} has changed, but it is not currently in use`
)
}
watcher.on('change', (filePath) => {
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will let the mean of filePath and publicPath more have clearly and consistence.

if (srcImportMap.has(file)) {
/** filter unused files */
if (!processedCSS.has(publicPath) && !srcImportMap.has(publicPath)) {
return debugCSS(
Copy link
Copy Markdown
Member Author

@underfin underfin May 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cache key of processedCSS should be publicPath instead of before check filePath.
According to

processedCSS.set(ctx.path, {
      css: result.code,
      modules: result.modules
    })

!Array.from(processedCSS.keys()).some((processed) =>
slash(file).includes(processed)
) &&
!srcImportMap.has(file)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should check the file if it is a css file first.

@yyx990803 yyx990803 merged commit 5435737 into vitejs:master May 26, 2020
hi-ogawa pushed a commit to hi-ogawa/vite that referenced this pull request Jul 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants