Skip to content

yurique/laminar-vite2-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

laminar-vite2-example

An example of a Vite build for a Scala.js + Laminar + frontroute app.

embedded-files

This app also demonstrates how to use the embedded-files – sbt plugin and the macro – to effectively achieve "resources" in Scala.js.

tailwindcss

The app is styled with tailwindcss.

installing npm dependencies

$ cd modules/website
$ yarn install

dev server

In sbt:

sbt:laminar-vite2-example> fastLinkJS
// OR, if you want sbt to watch the source changes and rebuild continuosly
sbt:laminar-vite2-example> ~fastLinkJS

Then, start the dev server:

$ yarn dev

production build

In sbt:

sbt:laminar-vite2-example> fullLinkJS

In the modules/website/index.html uncomment the reference to the production main.js (TODO: automate this?)

Run the build:

$ yarn build

The assets will end up in the dist directory.

  • index.*.js ~880K
  • vendor.*.js ~43K
  • index.*.css ~4.3K

To preview the production build:

$ yarn serve

Scala 3

You can build this app with Scala 3:

  • uncomment the corresponding line in the build.sbt (and comment the other one), same in the vite.config.js

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published