Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yurique/laminar-vite2-example
https://github.com/yurique/laminar-vite2-example
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/yurique/laminar-vite2-example
- Owner: yurique
- Created: 2021-02-26T02:11:04.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-06-03T22:03:34.000Z (over 3 years ago)
- Last Synced: 2023-03-01T03:02:23.317Z (over 1 year ago)
- Language: Scala
- Size: 1.55 MB
- Stars: 17
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# laminar-vite2-example
An example of a [Vite](https://vitejs.dev/) build for a [Scala.js](https://scala-js.org) + [Laminar](https://github.com/raquo/Laminar) +
[frontroute](https://github.com/tulz-app/frontroute) app.## embedded-files
This app also demonstrates how to use the [embedded-files](https://github.com/yurique/embedded-files/) – sbt plugin and
the macro – to effectively achieve "resources" in Scala.js.## tailwindcss
The app is styled with [tailwindcss](https://tailwindcss.com/).
## installing npm dependencies
```console
$ 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:
```console
$ 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`:
```console
$ 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:
```console
$ 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`