Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

How to use the rollup plugin #350

Open
DrMabuse23 opened this issue May 20, 2020 · 4 comments
Open

How to use the rollup plugin #350

DrMabuse23 opened this issue May 20, 2020 · 4 comments
Milestone

Comments

@DrMabuse23
Copy link

DrMabuse23 commented May 20, 2020

What problem does this feature solve?

Hi thx for your Package, but iam not sure how to run this script ? i'm using at the moment the vue-cli to create a web-component output. vue-cli-service build --target wc --name <%=name%> and now how to use this plugin then ? i need to add rollup ? or this hook into the vue cli build ? Sorry for my stupid questions but i don't see any on the docs how to run a build with that

What does the proposed API look like?

just add something like you could run the build then as expected with : ...

@przemkow
Copy link
Contributor

Hi.
Yes, if you want to use this plugin you need to change build process of your application and migrate to rollup.
rollup-plugin-vue is a .vue files loader created for rollup (you can think as equivalent to same vue-loader` in webpack world https://github.com/vuejs/vue-loader.)

Vue-cli is a tool created on top of webpack which use vue-loader under the hood to simplify work needed to setup a Vue.js project.

About targeting web component you need to pass isWebComponent: true as a Vue plugin option in rollup config. Also check this blog post, I think it might help to answer your question.
https://znck.dev/blog/2019-shipping-web-components-with-vue

@DrMabuse23
Copy link
Author

Thank you very much @przemkow i will try that out

@DrMabuse23
Copy link
Author

Sorry maybe you can help another time but we are using typescript and i see you are on this https://github.com/przemkow/rollup-plugin-vue/tree/typescript-example did you know when this is done ?

@przemkow
Copy link
Contributor

przemkow commented Jun 30, 2020

Hi @DrMabuse23, I think this example is not something you are looking for. It was added as an example to the next version of rollup-plugin-vue which will be used with Vue3.

Answering your question PR with this example is currently in Core Review but I am not sure when it will be merged.
#357

About TypeScript I created some time ago more advanced example as an answer under this issue #343 (comment)
So for this approach works fine in my projects.

@znck znck added this to the Zero Issues milestone Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants