What is the best way to build pure Vue components using Typescript

Viewed 184

I'm building new project using Typescript, Vue, webpack and lerna to manage related packages. Structure of my project is:

/packages
    /lib-vue-components
    /lib-ts-components
   /app

lib-vue-components are meant to be reusable components which i would use in any other Vue component within my app: i.e

import {MyComponent} from "lib-vue-components"

@Component({components: MyComponent})
class AppComponent extends Vue {
        ....
        })

I thinkng about 2 approaches:

  1. Do not build lib-vue-components as separate build, just use sources directly and build everything togehter with App project. This is the simplest way but do not allow to public lib-vue-componenets to npm.

2) Build lib-vue-components separetly and then use it in App projec as external libt. This is the way which looks the best for me but i not sure how to build pure vue+typescript components lib, cause webpack always addes a lot of code to output bundle(i.e it adds Vue itself).

Do you have any recepies/ideas what approach would be the best in this scenario?

0 Answers
Related