Giter VIP home page Giter VIP logo

scala-js.g8's Introduction

A Giter8 template for Scala.js projects, created by following the official Scala.js documentation with some tiny improvements.

The project is using only two dependencies (other than Scala.js): scala-js-dom and scalatest. You can easily remove them if you want.

Usage

If you have SBT version 0.13.13 or later, you can simply run:

sbt new tues/scala-js.g8

It will ask you a few questions (project name, Scala version etc.) and create a new directory named after the project.

After generating the project, you may want to edit the following files:

  • src/main/scala/MainApp.scala: contains a simple "hello world"
  • src/main/resources/index.html: a minimal HTML page which loads the generated JavaScript automatically
  • build.sbt: SBT build file, contains things such as library dependencies and a small snippet of code which generates index-dev.html (for use with fastOptJS) automatically based on index.html

The easiest way to build your project is:

sbt fastOptJS

You can then open target/scala-2.12/classes/index-dev.html (generated from your index.html) in your browser.

If you want SBT to automatically rebuild the project every time you change some files, run:

sbt '~fastOptJS'

Building with full optimization for production can be done with:

sbt fullOptJS

To use the fully optimized JavaScript you should open target/scala-2.12/classes/index.html (which is simply copied from your src/main/resources/).

Please consult Scala.js documentation for details.

Contributing

All contributions are welcome. Please try to provide meaningful commit descriptions and make your commits atomic if possible.

Feel free to edit the copyright information in this file if you want to be included as one of the authors. By submitting a pull request you acknowledge that you are the author of the patch and you agree to redistribute the modified code under the same license as used by this project.

Template license

Written in 2017 by Paweł Bartkiewicz

To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this template to the public domain worldwide. This template is distributed without any warranty. See http://creativecommons.org/publicdomain/zero/1.0/.

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.