Skip to content

Commit bc203ec

Browse files
committed
Switch to Vite and Scala.js plugin
1 parent 58f679a commit bc203ec

13 files changed

+3014
-35
lines changed

.github/workflows/ci.yml

+2-11
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,9 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v2
11-
- uses: olafurpg/setup-scala@v10
12-
- name: Build fast and optimised JS
13-
run: sbt ';fastLinkJS; fullLinkJS'
14-
- name: Prepare folder for gh-pages
15-
run: |
16-
mkdir -p site/target/scala-2.13
17-
cp -r target/scala-2.13/laminar-static-fastopt site/target/scala-2.13
18-
cp -r target/scala-2.13/laminar-static-opt site/target/scala-2.13
19-
cp index-dev.html site
20-
cp index-prod.html site
11+
- run: npm install && npm run build
2112
- name: Publish gh-pages
2213
uses: peaceiris/actions-gh-pages@v3
2314
with:
2415
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
publish_dir: ./site
16+
publish_dir: ./dist

.scalafmt.conf

+16
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
11
version = "3.7.1"
2+
runner.dialect = scala3
3+
rewrite.scala3.insertEndMarkerMinLines = 10
4+
rewrite.scala3.removeOptionalBraces = true
5+
rewrite.scala3.convertToNewSyntax = true
6+
align.preset = more
7+
8+
fileOverride {
9+
"glob:**.sbt" {
10+
runner.dialect = scala212source3
11+
}
12+
13+
"glob:**/project/**.*" {
14+
runner.dialect = scala212source3
15+
}
16+
}
17+

build.sbt

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1-
scalaVersion := "2.13.4"
1+
scalaVersion := "3.2.2"
22

33
enablePlugins(ScalaJSPlugin)
44

55
scalaJSUseMainModuleInitializer := true
66

7-
libraryDependencies += "com.raquo" %%% "laminar" % "0.14.5"
7+
libraryDependencies += "com.raquo" %%% "laminar" % "15.0.0"
88

99
name := "laminar-static"
10+
11+
import org.scalajs.linker.interface.ModuleSplitStyle
12+
13+
scalaJSLinkerConfig ~= {
14+
_.withModuleKind(ModuleKind.ESModule)
15+
.withModuleSplitStyle(
16+
ModuleSplitStyle.SmallModulesFor(List("example")))
17+
}

index.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

index.html

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<link rel="stylesheet" href="index.css">
8+
<title>Laminar test</title>
9+
</head>
10+
11+
<body class="w-full">
12+
<div id="appContainer" class="mx-8 my-8 w-fill "></div>
13+
<script src="/main.js" type="module"></script>
14+
</body>
15+
16+
</html>

main.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import 'scalajs:main.js';

0 commit comments

Comments
 (0)