vuejs / rollup-plugin-vue

Roll .vue files
https://vuejs.github.io/rollup-plugin-vue
MIT License
843 stars 148 forks source link

Complete rollup example for Vue 3 component lang="ts" #380

Open mesqueeb opened 4 years ago

mesqueeb commented 4 years ago

What problem does this feature solve?

If we have a single Vue 3 component with lang="ts", and we want to host this component on NPM to use it in multiple projects, it's not 100% clear to me - given the requirements below - how to best use rollup to prepare the component for publishing on NPM.

Requirements:

If there's a concrete example of how to do the above, I believe that would benefit a lot of Vue developers that wanna publish single Vue components!

What does the proposed API look like?

An example of such an example would be:

  1. example input from vue file:
    <template>// ...
    <style>// ...
    <script lang="ts">// ...
  2. required config:
    // required rollup config file contents
  3. execute this:
    # the command we need to execute to rollup the component
  4. this will be the compiled output:
    // an example of what kind of file is generated based on the above
mesqueeb commented 4 years ago

is there any way I can add some issuehunt funding?