Swap rollup with vite for building and watching code, added support for Vue, linting #515
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Rollup
832K frontend.js
288K frontend.css
Vite
832K frontend.js
288K frontend.css
Vite + Vue (+ example component)
872K frontend.js
288K frontend.css