Code Monkey home page Code Monkey logo

scalajs-all-in-one-template's Introduction

All-in-One Scala.js Static Web Project Template

Open in Gitpod

This repository is a template of the basic structure for a Scala.js web project, contains all the best technologies in Scala.js community until 2020:

Other libraries and tools can be found in sbt settings.

This template contains settings for a static web project, and you can additionally configure Play or Akka HTTP dependencies in web/build.sbt to turn it into a dynamic web project.

Directory Structure

  • web/

    The sbt-web project for web assets

    • build.sbt

      Sbt settings for the sbt-web project, which contains WebJars dependency configurations, including SASS / SCSS dependencies and static resources from external libraries.

    • src/main/assets/

      The root directory of static assets sources.

      • index.html

        The main page in release mode, which reference uglified version of CSS and JS resources.

      • devMod.html

        The main page in development mode, which reference indented CSS and JS resources.

      • style.scss

        The style sheet used by main page in SCSS syntax, which will be compiled to style.css by sbt-web pipeline.

    • target/web/public/main/

      The root directory of static assets output.

      • lib/

        The output directory for Webjars dependencies.

  • js/

    The Scala.js project to create JS output used in the sbt-web project.

    • build.sbt

      Sbt settings for the Scala.js project, which contains Scala.js settings, NPM dependencies and type definitions.

    • src/main/scala/

      The directory contains Scala.js source files.

  • project/

    • plugins.sbt

      Sbt plugins dependencies.

    • coursier.sbt

      sbt-coursier settings.

    • project/

      • plugins.sbt

        sbt-coursier settings.

Requirements

How to use this template?

Just clone this repository, and the following sbt tasks are available.

Build

Run the following command:

sbt assets

Then visit web/target/web/public/main/index.html to browse the main page.

Development build

By default, the assets command builds Scala.js in release mode. To build this project in development mode

sbt "set web / scalaJSPipeline / isDevMode := true" assets

Then visit web/target/web/public/main/devMod.html to browse the main page in development mode.

Test

Run the following command:

sbt test

Then the examples in Scaladoc comments will be ran by ScalaTest.

scalajs-all-in-one-template's People

Contributors

elang1121 avatar

Watchers

zgm avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.