Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swap rollup with vite for building and watching code, added support for Vue, linting #515

Merged
merged 6 commits into from
Oct 2, 2024

Conversation

patrick11514
Copy link
Contributor

@patrick11514 patrick11514 commented Sep 27, 2024

Current setup with rollup was working, but it has some flaws.
For example:
rollup-plugin-vite was designed to work with rollup-plugin-typescript, which was deprecated and people should use @rollup/plugin-typescript instead, which doesn't work with vue plugin, so people created fork called rollup-plugin-typescript2. Because content of <script setup lang="ts"> was processed by typescript plugin, it can't import vue files, because it doesn't know them, but with some tweaks I successfully fixed this issue, but then another came in. When I was using watch mode, the files (primarly Vue files) which was using typescript plugin was somehow cached and changes doesn't show up in build files, even If i used the @vitejs/plugin-vue, because this issue ezolenko/rollup-plugin-typescript2#433 (comment).

So we decided to switch to Vite completely.

Hopefully everything will work. 🙏

Changes:

  • Swapped Rollup with Vite

Rollup

832K frontend.js
288K frontend.css

Vite

832K frontend.js
288K frontend.css

  • because Vite uses Rollup under the hood, bundle sizes seems same

Vite + Vue (+ example component)

872K frontend.js
288K frontend.css

  • Added support for Vue
  • Added eslint + prettier

@geordi
Copy link
Member

geordi commented Sep 28, 2024

Thank you! I'll try to test it throughout the weekend.

@patrick11514 patrick11514 changed the title Swap rollup with vite for building and watching code Swap rollup with vite for building and watching code, added support for Vue, linting Sep 30, 2024
Copy link
Collaborator

@Kobzol Kobzol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good. This even updates to Svelte 4, but that should hopefully be also fine.

Attempt number 3.

@Kobzol Kobzol merged commit 203c969 into mrlvsb:master Oct 2, 2024
1 check passed
@Kobzol
Copy link
Collaborator

Kobzol commented Oct 2, 2024

Everything looks fine 🎉

@geordi
Copy link
Member

geordi commented Oct 2, 2024

Thanks @patrick11514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants