You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Vite for an app plugin. The plugin need to dist bundles of modules JS and CSS files to run in the app environment.
So I must use the build.lib option and build.watch with an outDir out of the project root for development.
I use the Rollup plugin livereload for js files, it's work pretty nice but unfortunately the CSS files are merged in a global css file outside of the plugin directory at the installation.
So the only way to develop CSS in live would be to inline them. I use CSS modules automatically bundled on build mode.
So CSS modules are well watched by Rollup but in this case it's useless since the CSS can't be reload by the main app.
Suggested solution
An option build.inlineCss: false | true (default to false) to inject it in the document.head with Javascript instead of creating the bundle.
Alternative
If there are any other solution for example with Rollup, I'm open to suggestions.
Or maybe I have a wrong approach of Vite.js, the initial problem was that the architecture of these plugins are considered as a library for Vite since there is no entry file index.html or main.js.
I found that issue #4454, it's not really the same problem but it raises the lack flexibility for assets (css included) on library mode.
Clear and concise description of the problem
Hi,
I'm using Vite for an app plugin. The plugin need to dist bundles of modules JS and CSS files to run in the app environment.
So I must use the
build.lib
option andbuild.watch
with anoutDir
out of the project root for development.I use the Rollup plugin
livereload
for js files, it's work pretty nice but unfortunately the CSS files are merged in a global css file outside of the plugin directory at the installation.So the only way to develop CSS in live would be to inline them. I use CSS modules automatically bundled on build mode.
So CSS modules are well watched by Rollup but in this case it's useless since the CSS can't be reload by the main app.
Suggested solution
An option
build.inlineCss: false | true
(default to false) to inject it in thedocument.head
with Javascript instead of creating the bundle.Alternative
If there are any other solution for example with Rollup, I'm open to suggestions.
Or maybe I have a wrong approach of Vite.js, the initial problem was that the architecture of these plugins are considered as a
library
for Vite since there is no entry fileindex.html
ormain.js
.I found that issue #4454, it's not really the same problem but it raises the lack flexibility for assets (css included) on library mode.
Additional context
Here is the
vite.config.js
https://github.com/kimsible/peertube-plugin-upload-limits/blob/master/vite.config.js
Validations
The text was updated successfully, but these errors were encountered: