2

I'm prototyping a single-spa which contains Vue apps built with Vite, following the very helpful example.

I've got vite build to generate a single js file that single-spa can point to, and that's being loaded fine.

However vite build always separates out the CSS into a separate CSS file. Ideally for use in single-spa it would be bundled within the same JS file. What's the optimal way to do this?

I can load this using the single-spa-css package, but I was expecting some rollup or vite.config.js option to achieve this.

Thank you!

Iainure
  • 169
  • 1
  • 12
  • Why do you need a single CSS file? – tauzN Sep 14 '21 at 14:35
  • 1
    Does this answer your question? [Bundle JS and CSS into single file with Vite](https://stackoverflow.com/questions/67781170/bundle-js-and-css-into-single-file-with-vite) – tauzN Sep 14 '21 at 14:36
  • 1
    The answer on that thread seems to relate to a Svelte plugin for vite - I'm using Vue, but a plugin like that is indeed what I'm after. – Iainure Sep 14 '21 at 15:48

0 Answers0