2023-03-03 14:07:42 +00:00
|
|
|
|
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
2023-02-08 08:59:57 +00:00
|
|
|
|
|
2023-02-16 12:47:42 +00:00
|
|
|
|
exports[`treeshake client only in ssr > should treeshake ClientOnly correctly in dev 1`] = `
|
2023-02-08 08:59:57 +00:00
|
|
|
|
"
|
|
|
|
|
|
2023-02-16 12:47:42 +00:00
|
|
|
|
import DontRemoveThisSinceItIsUsedInSetup from './ComponentWithProps.vue'
|
2023-04-07 16:02:47 +00:00
|
|
|
|
import { Glob } from '#components'
|
2023-02-08 08:59:57 +00:00
|
|
|
|
|
|
|
|
|
|
2023-05-11 08:37:32 +00:00
|
|
|
|
const hello = 'world'
|
2023-02-16 12:47:42 +00:00
|
|
|
|
|
2023-02-08 08:59:57 +00:00
|
|
|
|
const _sfc_main = {
|
|
|
|
|
__name: 'SomeComponent1',
|
2023-05-11 08:37:32 +00:00
|
|
|
|
setup(__props, { expose: __expose }) {
|
|
|
|
|
__expose();
|
2023-02-08 08:59:57 +00:00
|
|
|
|
|
|
|
|
|
|
2023-02-16 12:47:42 +00:00
|
|
|
|
const NotDotClientComponent = defineAsyncComponent(() => import('./../some.island.vue'))
|
|
|
|
|
|
|
|
|
|
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 { 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, } = 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 [ { Dont, }, 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-16 12:47:42 +00:00
|
|
|
|
|
2023-04-07 16:02:47 +00:00
|
|
|
|
const __returned__ = { hello, NotDotClientComponent, NotToBeTreeShaken, ButShouldNotBeTreeShaken, isThis, woooooo, Dont, That, DontRemoveThisSinceItIsUsedInSetup, get Glob() { return Glob }, }
|
2023-02-08 08:59:57 +00:00
|
|
|
|
Object.defineProperty(__returned__, '__isScriptSetup', { enumerable: false, value: true })
|
|
|
|
|
return __returned__
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2023-12-11 18:20:11 +00:00
|
|
|
|
import { withCtx as _withCtx, createVNode as _createVNode, resolveComponent as _resolveComponent } from "vue"
|
|
|
|
|
import { ssrRenderComponent as _ssrRenderComponent, ssrRenderAttrs as _ssrRenderAttrs, ssrInterpolate as _ssrInterpolate } from "vue/server-renderer"
|
2023-02-08 08:59:57 +00:00
|
|
|
|
|
|
|
|
|
function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
|
2023-12-11 18:20:11 +00:00
|
|
|
|
const _component_DotClientComponent = _resolveComponent("DotClientComponent")
|
|
|
|
|
const _component_AutoImportedNotTreeShakenComponent = _resolveComponent("AutoImportedNotTreeShakenComponent")
|
|
|
|
|
const _component_ClientOnly = _resolveComponent("ClientOnly")
|
2023-02-08 08:59:57 +00:00
|
|
|
|
|
2023-02-16 12:47:42 +00:00
|
|
|
|
_push(\`<div\${_ssrRenderAttrs(_attrs)} data-v-one-hash>\`)
|
2023-12-11 18:20:11 +00:00
|
|
|
|
_push(_ssrRenderComponent($setup["NotDotClientComponent"], null, {
|
2023-02-16 12:47:42 +00:00
|
|
|
|
|
|
|
|
|
/* STABLE */
|
|
|
|
|
}, _parent))
|
|
|
|
|
_push(\`<div data-v-one-hash>\`)
|
2023-12-11 18:20:11 +00:00
|
|
|
|
_push(_ssrRenderComponent($setup["Glob"], null, null, _parent))
|
|
|
|
|
_push(\`</div> \${_ssrInterpolate($setup.hello)} <div class="not-client" data-v-one-hash> Hello </div>\`)
|
2023-02-16 12:47:42 +00:00
|
|
|
|
_push(_ssrRenderComponent(_component_DotClientComponent, null, {
|
2023-02-08 08:59:57 +00:00
|
|
|
|
|
|
|
|
|
/* STABLE */
|
|
|
|
|
}, _parent))
|
|
|
|
|
_push(_ssrRenderComponent(_component_ClientOnly, null, {
|
|
|
|
|
|
|
|
|
|
/* STABLE */
|
|
|
|
|
}, _parent))
|
2023-12-11 18:20:11 +00:00
|
|
|
|
_push(_ssrRenderComponent($setup["ButShouldNotBeTreeShaken"], null, null, _parent))
|
|
|
|
|
_push(_ssrRenderComponent($setup["Dont"], null, null, _parent))
|
|
|
|
|
_push(_ssrRenderComponent($setup["That"], null, null, _parent))
|
|
|
|
|
_push(_ssrRenderComponent($setup["NotToBeTreeShaken"], null, null, _parent))
|
2023-02-16 12:47:42 +00:00
|
|
|
|
_push(_ssrRenderComponent(_component_AutoImportedNotTreeShakenComponent, null, null, _parent))
|
2023-02-08 08:59:57 +00:00
|
|
|
|
_push(\`</div>\`)
|
|
|
|
|
}
|
|
|
|
|
|
2023-12-11 18:20:11 +00:00
|
|
|
|
import "SomeComponent1.vue?vue&type=style&index=0&scoped=one-hash&lang.css"
|
2023-02-08 08:59:57 +00:00
|
|
|
|
|
|
|
|
|
import { useSSRContext as __vite_useSSRContext } from 'vue'
|
|
|
|
|
const _sfc_setup = _sfc_main.setup
|
|
|
|
|
_sfc_main.setup = (props, ctx) => {
|
|
|
|
|
const ssrContext = __vite_useSSRContext()
|
2023-12-11 18:20:11 +00:00
|
|
|
|
;(ssrContext.modules || (ssrContext.modules = new Set())).add("SomeComponent1.vue")
|
2023-02-08 08:59:57 +00:00
|
|
|
|
return _sfc_setup ? _sfc_setup(props, ctx) : undefined
|
|
|
|
|
}
|
|
|
|
|
import _export_sfc from ' |