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

feat(hmr): deduplicate paths and join them with commas #10891

Merged
merged 1 commit into from Nov 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions packages/vite/src/node/server/hmr.ts
Expand Up @@ -181,9 +181,8 @@ export function updateModules(
}

config.logger.info(
updates
.map(({ path }) => colors.green(`hmr update `) + colors.dim(path))
.join('\n'),
colors.green(`hmr update `) +
colors.dim([...new Set(updates.map((u) => u.path))].join(', ')),
{ clear: true, timestamp: true }
)
ws.send({
Expand Down
3 changes: 2 additions & 1 deletion playground/tailwind/src/components/HelloWorld.vue
Expand Up @@ -5,5 +5,6 @@
</template>

<script setup lang="ts">
const count = 1
import { INITIAL_COUNT } from '../utils.ts'
const count = INITIAL_COUNT
</script>
2 changes: 2 additions & 0 deletions playground/tailwind/src/utils.ts
@@ -0,0 +1,2 @@
export const NAME = 'Tailwind'
export const INITIAL_COUNT = 1
5 changes: 4 additions & 1 deletion playground/tailwind/src/views/Page.vue
Expand Up @@ -5,7 +5,7 @@
<div
class="tailwind-style bg-red-100 inline-block h-24 px-8 mb-8 text-[#888888]"
>
Tailwind style
{{ name }} style
</div>
<HelloWorld />
<PugTemplate />
Expand All @@ -16,13 +16,16 @@
import { defineComponent, ref } from 'vue'
import HelloWorld from '../components/HelloWorld.vue'
import PugTemplate from '../components/PugTemplate.vue'
import { NAME } from '../utils.ts'

export default defineComponent({
components: { HelloWorld, PugTemplate },
setup() {
const name = NAME
const val = ref(0)

return {
name,
val
}
}
Expand Down