scala-js / vite-plugin-scalajs

Vite plugin for integration of Scala.js
Apache License 2.0
51 stars 10 forks source link

Astro + vite integration #12

Closed fcabouat closed 1 year ago

fcabouat commented 1 year ago

Hello,

Does this plugin work with Astro ? Is there a working example out there?

Cheers,

François

sjrd commented 1 year ago

I don't know. I don't know Astro. I suggest you give it a try.

fcabouat commented 1 year ago

The idea was to use Astro as a static site generator that embeds Vite + some scalajs interactivity.

It seems that just adding the scalajs plugin naively in the vite plugins section of Astro config doesn't do the trick, and I don't know the lifecycles of all of those tools enough to get what hook might be missing, or how to tell the plugin to process .astro template files.

image

fcabouat commented 1 year ago

Sorry, issues were with the Astro config, not the Vite ScalaJs config.

I restarted from scratch, not with the Astro Getting Started but taking inspiration from : https://astro.build/themes/details/astro-vanilla-ts/ (closer to my intended usecase), and I can confirm I managed to get a Hello World from Scala / it works perfectly !

Sorry for the noise,

François