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: Preview watch not refreshed when CSS file is changed #159

Merged
merged 2 commits into from
Mar 27, 2021

Conversation

MurakamiShinyu
Copy link
Member

This is a follow-up fix of #149.

pathStartsWith(path, theme.destination),
config.themeIndexes.find(
(theme) =>
(theme as any).destination !== theme.location &&
Copy link
Member

Choose a reason for hiding this comment

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

Don't use as any. We can do type narrowing by theme.type !== 'file'.

Suggested change
(theme as any).destination !== theme.location &&
(theme.type !== 'file' || theme.destination !== theme.location) &&

Copy link
Member Author

Choose a reason for hiding this comment

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

修正しました。

              (theme.type === 'file' || theme.type === 'package') &&
              theme.destination !== theme.location &&
              (theme.type === 'file'
                ? path === theme.destination
                : pathStartsWith(path, theme.destination)),

としました。 theme.type === 'package' の場合でも theme.destination !== theme.location のチェックをするべきだと考えたためです。(#160 で「ローカル theme について、いま行っている theme のファイルのコピーを行わない」ようにする提案をしています。その場合 theme.type === 'package' の場合でも theme.destination === theme.location となります。)

Copy link
Member

@spring-raining spring-raining left a comment

Choose a reason for hiding this comment

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

LGTM

@spring-raining spring-raining merged commit 0c1a1e2 into develop Mar 27, 2021
@spring-raining spring-raining deleted the fix/preview-watch-theme-css branch March 27, 2021 08:45
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