diff --git a/README.md b/README.md index daf3e9d..7aaec18 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,25 @@ See an online demo here: https://japgolly.github.io/scalajs-benchmark/. ## How do I use it? -1. Include `scalajs-benchmark` as a dependency in your Scala.JS project. +1. Include the Scala.js and JsDependencies plugins in your sbt `project/plugins.sbt` file: + ```scala + addSbtPlugin("org.scala-js" %% "sbt-scalajs" % "1.7.1") + addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2") + ``` + +2. Enable the plugins in your sbt project. + ```scala + enablePlugins(ScalaJSPlugin, JSDependenciesPlugin) + ``` + +3. Include `scalajs-benchmark` as a dependency in your Scala.JS project, along with chartjs. ```scala libraryDependencies += "com.github.japgolly.scalajs-benchmark" %%% "benchmark" % "0.10.0" + + jsDependencies += "org.webjars" % "chartjs" % "1.0.2" / "Chart.js" minified "Chart.min.js" ``` -1. You write benchmarks. +4. Write benchmarks your benchmarks. ```scala import japgolly.scalajs.benchmark._ import japgolly.scalajs.benchmark.gui._ @@ -44,9 +57,23 @@ See an online demo here: https://japgolly.github.io/scalajs-benchmark/. *(Hey, can you make that `1 to 100` configurable in the GUI? [You sure can.](https://github.com/japgolly/scalajs-benchmark/blob/master/demo/src/main/scala/demo/suites/example/Examples.scala))* -1. Add a tiny loader HTML [like this](demo/scala213-full.html). +5. Add a tiny loader HTML [like this](demo/scala213-full.html) file called `index.html` to the root directory of your project. In this example our project is called 'demo'. `demo-fastopt.js` is the result of our compiled benchmark suite, while `demo-jsdeps.js` is produced by the `JsDependencies` plugin.: + ```html + + +
+