Vue@2.6.14 Webpack@4.29.6
<template>
<module-a v-if="isClientA"></module-a>
<module-b v-else></module-b>
</template>
<script>
export default {
computed: {
isClientA() {
return process.env.VUE_APP_CLIENT === 'A'
}
}
}
</script>
In above case, if tree shaking feature works, module-b's code should not be included in the build package when VUE_APP_CLIENT is set to A. But it failed.
Is tree shaking not works in template syntax ?
Hope your help, thanks.