I have a Vue site that is built with Webpack. I have a TypeScript file that contains a component:
// my-component.ts
import Vue = require('vue');
export default Vue.component("my-component", {
template: "<div>I am a component</div>"
});
When I try to use this component I get the following warning:
You are using the runtime-only build of Vue where the template option is not available. Either pre-compile the templates into render functions, or use the compiler-included build.
Now: how do I pre-compile this template? I know I can define a .vue
file and even use TypeScript inside <script></script>
, but I would rather define my component in pure TypeScript.
Is this possible at all?
PS: I know I can also go with the second option by creating an alias for the compiler-included build at vue/dist/vue.js
but I feel like this gives me a performance penalty.