Skip to content

Commit

Permalink
Switch to use nodeJsEnv as default jsEnv to build scala.js
Browse files Browse the repository at this point in the history
By default, scala.js compiler uses `Rhino` as the js environment. But it
usually requires a lot of memory and often lead to OOM. This PR replace
the default to a node.js one that should be much faster and slimer.
  • Loading branch information
ngbinh committed Mar 27, 2016
1 parent df56b82 commit 5784a6f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ scala:
script:
- scripts/travis-publish.sh

# http://austinpray.com/ops/2015/09/20/change-travis-node-version.html
install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $TRAVIS_NODE_VERSION
- npm install

notifications:
webhooks:
urls:
Expand All @@ -21,12 +26,15 @@ env:
global:
- secure: Kf44XQFpq2QGe3rn98Dsf5Uz3WXzPDralS54co7sqT5oQGs1mYLYZRYz+I75ZSo5ffZ86H7M+AI9YFofqGwAjBixBbqf1tGkUh3oZp2fN3QfqzazGV3HzC+o41zALG5FL+UBaURev9ChQ5fYeTtFB7YAzejHz4y5E97awk934Rg=
- secure: QbNAu0jCaKrwjJi7KZtYEBA/pYbTJ91Y1x/eLAJpsamswVOvwnThA/TLYuux+oiZQCiDUpBzP3oxksIrEEUAhl0lMtqRFY3MrcUr+si9NIjX8hmoFwkvZ5o1b7pmLF6Vz3rQeP/EWMLcljLzEwsrRXeK0Ei2E4vFpsg8yz1YXJg=
- TRAVIS_NODE_VERSION="4"
cache:
directories:
- $HOME/.sbt/0.13/dependency
- $HOME/.sbt/boot/scala*
- $HOME/.sbt/launchers
- $HOME/.ivy2/cache
- $HOME/.nvm

before_cache:
- du -h -d 1 $HOME/.ivy2/cache
- du -h -d 2 $HOME/.sbt/
Expand Down
6 changes: 5 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ lazy val commonJsSettings = Seq(
s"-P:scalajs:mapSourceURI:$a->$g/"
},
scalaJSStage in Global := FastOptStage,
parallelExecution := false
parallelExecution := false,
// Using Rhino as jsEnv to build scala.js code can lead to OOM, switch to PhantomJS by default
scalaJSUseRhino := false,
requiresDOM := false,
jsEnv := NodeJSEnv().value
)

lazy val commonJvmSettings = Seq(
Expand Down

0 comments on commit 5784a6f

Please sign in to comment.