Mironor
Mironor

Reputation: 1187

How to prevent Play framework test execution from loading node modules?

in a play framework application each time I run "sbt test" it tries to load all node modules due to the fact that I have package.json in application root.

Here is my sbt file:

import play.PlayScala

scalaVersion := "2.11.1"

name := """Livrarium"""

version := "0.1"

libraryDependencies ++= Seq(
  "com.typesafe.play" %% "play-slick" % "0.8.0",
  "org.postgresql" % "postgresql" % "9.3-1102-jdbc4",
  "com.mohiva" %% "play-silhouette" % "1.0",
  "org.scaldi" %% "scaldi-play" % "0.4.1",
  "com.sksamuel.scrimage" %% "scrimage-core" % "1.4.1",
  "com.sksamuel.scrimage" %% "scrimage-canvas" % "1.4.1",
  "org.bouncycastle" % "bcprov-jdk16" % "1.45",
  "org.apache.pdfbox" % "pdfbox" % "1.8.6"
)

lazy val root = (project in file(".")).enablePlugins(PlayScala)

As you can see, there is no sbt-web.

Is there anything I can do to restrict sbt from loading node modules?

Upvotes: 0

Views: 197

Answers (1)

Mironor
Mironor

Reputation: 1187

It turns out I had web plugins enabled in /project/plugin.sbt

After removing these lines:

// web plugins

addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.1")

addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.0.0")

addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.0.0")

sbt stoped trying to load npm modules.

Upvotes: 1

Related Questions