Search code examples
playframework-2.0typesafe-activator

How to make activator dist ignore the package.json in the project root?


When running activator dist, npm install seems to executed automatically along with it in a step that appears in the logs as [error] (web-assets:jseNpmNodeModules) Problems with NPM resolution. Aborting build. In my setup this should not happen as the CD server where the build is running is not equipped to resolve all dependencies through npm. How can I disable this automatic behavior in sbt 0.13.8 with play plugin 2.4.2.


Solution

  • This issue is related to the JsEngine npmNodeModules step. A Google groups post provided the following solution to disabled this step during build: Setting JsEngineKeys to Nil in build.sbt as shown below solved the issue:

    lazy val root = (project in file("."))
      .enablePlugins(PlayScala, BuildInfoPlugin)
      .settings(
        // Disable NPM node modules
        JsEngineKeys.npmNodeModules in Assets := Nil,
        JsEngineKeys.npmNodeModules in TestAssets := Nil
      )