2023-02-08 08:59:57 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
2023-02-16 12:47:42 +00:00
|
|
|
<NotDotClientComponent>
|
|
|
|
<ByeBye />
|
|
|
|
</NotDotClientComponent>
|
2023-02-08 08:59:57 +00:00
|
|
|
<div>
|
|
|
|
<Glob />
|
|
|
|
</div>
|
|
|
|
{{ hello }}
|
|
|
|
<div class="not-client">
|
|
|
|
Hello
|
|
|
|
</div>
|
2023-02-16 12:47:42 +00:00
|
|
|
<DotClientComponent>
|
2023-02-08 08:59:57 +00:00
|
|
|
<HelloWorld />
|
|
|
|
<Glob />
|
|
|
|
<SomeGlob />
|
2023-02-16 12:47:42 +00:00
|
|
|
<SomeIsland />
|
|
|
|
<NotToBeTreeShaken />
|
|
|
|
<ObjectPattern />
|
|
|
|
<ObjectPatternDeclaration />
|
|
|
|
<AutoImportedNotTreeShakenComponent />
|
|
|
|
<AutoImportedComponent />
|
|
|
|
<Halllo />
|
|
|
|
<Both />
|
|
|
|
<AreTreeshaken />
|
|
|
|
</DotClientComponent>
|
2023-02-08 08:59:57 +00:00
|
|
|
<ClientOnly>
|
|
|
|
<div class="should-be-treeshaken">
|
|
|
|
this should not be visible
|
|
|
|
</div>
|
|
|
|
<ClientImport />
|
|
|
|
<Treeshaken />
|
|
|
|
<ResolvedImport />
|
2023-02-16 12:47:42 +00:00
|
|
|
<FromArray />
|
|
|
|
<Please />
|
|
|
|
<Doo />
|
|
|
|
<What />
|
|
|
|
<Deep />
|
|
|
|
<Pattern />
|
|
|
|
<DontRemoveThisSinceItIsUsedInSetup />
|
2023-02-08 08:59:57 +00:00
|
|
|
</ClientOnly>
|
2023-02-16 12:47:42 +00:00
|
|
|
<ButShouldNotBeTreeShaken />
|
|
|
|
<Dont />
|
|
|
|
<That />
|
|
|
|
<NotToBeTreeShaken />
|
|
|
|
<AutoImportedNotTreeShakenComponent />
|
2023-02-08 08:59:57 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { Treeshaken } from 'somepath'
|
|
|
|
import HelloWorld from '../HelloWorld.vue'
|
2023-02-16 12:47:42 +00:00
|
|
|
import DontRemoveThisSinceItIsUsedInSetup from './ComponentWithProps.vue'
|
2023-04-07 16:02:47 +00:00
|
|
|
import { ClientImport, Glob } from '#components'
|
|
|
|
import { AreTreeshaken, Both } from '#imports'
|
2023-02-08 08:59:57 +00:00
|
|
|
|
|
|
|
const hello = 'world'
|
2023-02-16 12:47:42 +00:00
|
|
|
const ByeBye = defineAsyncComponent(() => import('./../some-glob.global.vue'))
|
|
|
|
|
|
|
|
const NotDotClientComponent = defineAsyncComponent(() => import('./../some.island.vue'))
|
|
|
|
const SomeIsland = defineAsyncComponent(async () => {
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.client) {
|
2023-02-16 12:47:42 +00:00
|
|
|
return (await import('./../some.island.vue'))
|
|
|
|
}
|
|
|
|
|
|
|
|
return {}
|
|
|
|
})
|
|
|
|
|
|
|
|
const NotToBeTreeShaken = defineAsyncComponent(async () => {
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.client) {
|
2023-02-16 12:47:42 +00:00
|
|
|
return (await import('./../HelloWorld.vue'))
|
|
|
|
}
|
|
|
|
|
|
|
|
return {}
|
|
|
|
})
|
|
|
|
|
|
|
|
const { ObjectPattern } = defineAsyncComponent(async () => {
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.client) {
|
2023-02-16 12:47:42 +00:00
|
|
|
return (await import('./../HelloWorld.vue'))
|
|
|
|
}
|
|
|
|
|
|
|
|
return {}
|
|
|
|
})
|
|
|
|
|
|
|
|
const { ObjectPattern: ObjectPatternDeclaration } = defineAsyncComponent(async () => {
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.client) {
|
2023-02-16 12:47:42 +00:00
|
|
|
return (await import('./../HelloWorld.vue'))
|
|
|
|
}
|
|
|
|
|
|
|
|
return {}
|
|
|
|
})
|
|
|
|
|
|
|
|
const { ObjectPattern: Halllo, ButShouldNotBeTreeShaken } = defineAsyncComponent(async () => {
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.client) {
|
2023-02-16 12:47:42 +00:00
|
|
|
return (await import('./../HelloWorld.vue'))
|
|
|
|
}
|
|
|
|
|
|
|
|
return {}
|
|
|
|
})
|
|
|
|
const isThis = {}
|
|
|
|
|
|
|
|
const { woooooo, What = isThis } = defineAsyncComponent(async () => {
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.client) {
|
2023-02-16 12:47:42 +00:00
|
|
|
return (await import('./../HelloWorld.vue'))
|
|
|
|
}
|
|
|
|
|
|
|
|
return {}
|
|
|
|
})
|
|
|
|
|
2023-09-19 21:26:15 +00:00
|
|
|
if (import.meta.client) {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.log(woooooo)
|
|
|
|
}
|
2023-02-16 12:47:42 +00:00
|
|
|
|
|
|
|
const { Deep, assignment: { Pattern = ofComponent } } = defineAsyncComponent(async () => {
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.client) {
|
2023-02-16 12:47:42 +00:00
|
|
|
return (await import('./../HelloWorld.vue'))
|
|
|
|
}
|
|
|
|
|
|
|
|
return {}
|
|
|
|
})
|
|
|
|
|
|
|
|
const [FromArray] = defineAsyncComponent(async () => {
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.client) {
|
2023-02-16 12:47:42 +00:00
|
|
|
return (await import('./../HelloWorld.vue'))
|
|
|
|
}
|
|
|
|
|
|
|
|
return {}
|
|
|
|
})
|
|
|
|
|
|
|
|
const [Please, { Dont, Doo }, That] = defineAsyncComponent(async () => {
|
2023-08-07 22:03:40 +00:00
|
|
|
if (import.meta.client) {
|
2023-02-16 12:47:42 +00:00
|
|
|
return (await import('./../HelloWorld.vue'))
|
|
|
|
}
|
|
|
|
|
|
|
|
return {}
|
|
|
|
})
|
|
|
|
|
2023-09-19 21:26:15 +00:00
|
|
|
if (import.meta.client) {
|
|
|
|
// eslint-disable-next-line no-console
|
|
|
|
console.log(DontRemoveThisSinceItIsUsedInSetup.props)
|
|
|
|
}
|
2023-02-08 08:59:57 +00:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.not-client {
|
|
|
|
color: "red";
|
|
|
|
}
|
|
|
|
</style>
|