a command line tool for doing all things nostr
Go to file
2022-02-23 10:06:03 -03:00
project a buildable scala-js (sbt ~fastLinkJS) project that does nothing. 2022-02-22 10:01:20 -03:00
src/main/scala/app first Handler component: Nothing. 2022-02-23 10:06:03 -03:00
.gitignore react, slinky, esbuild and a readme. 2022-02-22 12:21:47 -03:00
.scalafmt.conf a buildable scala-js (sbt ~fastLinkJS) project that does nothing. 2022-02-22 10:01:20 -03:00
build.js react, slinky, esbuild and a readme. 2022-02-22 12:21:47 -03:00
build.sbt react, slinky, esbuild and a readme. 2022-02-22 12:21:47 -03:00
globals.js react, slinky, esbuild and a readme. 2022-02-22 12:21:47 -03:00
index.html react, slinky, esbuild and a readme. 2022-02-22 12:21:47 -03:00
package.json react, slinky, esbuild and a readme. 2022-02-22 12:21:47 -03:00
README.md react, slinky, esbuild and a readme. 2022-02-22 12:21:47 -03:00

This is a boilerplate for ScalaJS + React apps using Slinky.

Most boilerplates and tutorials for ScalaJS out there use scajajs-bundler, which wraps Webpack and is probably great, but not for me. I don't like Webpack, but would be fine if it worked, however I get very confused about it, get different errors every time I try and I don't like that I don't understand what it is doing.

Apparently all scalajs-bundler does is bundle together the npm packages into the same file that results from the ScalaJS compilation.

Here instead we have two files: one is the one that comes from ScalaJS, target/scala-2.13/app-fastopt/main.js and the other is one that comes from globals.js when built with esbuild, globals.bundle.js. These two are included in index.html.

To start building your app, run yarn start (or npm run start) and it will bundle the dependencies then start watching the Scala files and rebuilding the main app.

If you want to add a new npm dependency, modify globals.js and restart yarn start.