Skip to content

Commit 967299a

Browse files
authoredNov 13, 2022
feat(hmr): deduplicate paths and join them with commas (#10891)
1 parent 92637a2 commit 967299a

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed
 

‎packages/vite/src/node/server/hmr.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,8 @@ export function updateModules(
181181
}
182182

183183
config.logger.info(
184-
updates
185-
.map(({ path }) => colors.green(`hmr update `) + colors.dim(path))
186-
.join('\n'),
184+
colors.green(`hmr update `) +
185+
colors.dim([...new Set(updates.map((u) => u.path))].join(', ')),
187186
{ clear: true, timestamp: true }
188187
)
189188
ws.send({

‎playground/tailwind/src/components/HelloWorld.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
</template>
66

77
<script setup lang="ts">
8-
const count = 1
8+
import { INITIAL_COUNT } from '../utils.ts'
9+
const count = INITIAL_COUNT
910
</script>

‎playground/tailwind/src/utils.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export const NAME = 'Tailwind'
2+
export const INITIAL_COUNT = 1

‎playground/tailwind/src/views/Page.vue

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div
66
class="tailwind-style bg-red-100 inline-block h-24 px-8 mb-8 text-[#888888]"
77
>
8-
Tailwind style
8+
{{ name }} style
99
</div>
1010
<HelloWorld />
1111
<PugTemplate />
@@ -16,13 +16,16 @@
1616
import { defineComponent, ref } from 'vue'
1717
import HelloWorld from '../components/HelloWorld.vue'
1818
import PugTemplate from '../components/PugTemplate.vue'
19+
import { NAME } from '../utils.ts'
1920
2021
export default defineComponent({
2122
components: { HelloWorld, PugTemplate },
2223
setup() {
24+
const name = NAME
2325
const val = ref(0)
2426
2527
return {
28+
name,
2629
val
2730
}
2831
}

0 commit comments

Comments
 (0)
Please sign in to comment.