ScalaJS Skeleton App
This is a Giter8 skeleton for ScalaJS. It can be launched with Electron or served with Express out-of-the-box. And launch configurations are pre-created for the Visual Studio Code editor. But, use of it is not required.
Download an install the following applications:
Next, run SBT on the command line to initialize a new sekeleton.
$ sbt new massung/scala-js-skeleton.g8 [-b webpack]
$ yarn install
Next, launch SBT and build the source for the skeleton.
Note: if you are using the webpack branch, run
At this point, you application's compiled
.js file has been built and resides in the
web/js folder along with a
To run your app, there are a few options:
Otherwise, you can manually run/debug via the command line:
$ ./node_modules/.bin/electron main.js [debug]
If you pass the
debug argument on the command line, then the webkit debugger will be opened as well. From there, you should have access to your Scala code, as a map file was generated for it.
Or start the Express server:
$ node server.js [port=8080]
Here is a high-level breakdown of the skeleton source files:
- project/ contains SBT plugins and settings
- src/ contains all the ScalaJS app code
- web/ contains all the static resources, and your app bundle
- main.js is the Electron application code
- server.js is the Express web server code