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: css cache check #262

Merged
merged 2 commits into from
May 26, 2020
Merged

fix: css cache check #262

merged 2 commits into from
May 26, 2020

Conversation

underfin
Copy link
Member

No description provided.

`${basename(file)} has changed, but it is not currently in use`
)
}
watcher.on('change', (filePath) => {
Copy link
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
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
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.

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