Giter VIP home page Giter VIP logo

Comments (4)

ryan-richt avatar ryan-richt commented on May 26, 2024

There are a few historical reports on the Gitter, but I don't think a known solution:

Bob R @tzbob Sep 09 2016 07:06
@vmunier I'm hitting some issues and I'm not sure if it's because of me, intellij or sbt-web-scalajs
Say I have code that doesn't compile in a regular sbt build, I import it into intellij and they run their sbt task to import sources and whatnot, everything works. When I do the same thing with an 'sbt-web-scalajs'-enabled project it seems like their tasks are triggering compilation.
Before I look into this, has anyone had a similar experience? I can't imagine being the only person who had this issue.

Binh Nguyen @ngbinh Mar 17 2017 04:11
Hey guys, when I switch to sbt-web-sclajs, everytime I refresh SBT in IntelliJ, it compiles the whole code base again. IntelliJ also clashes with my external ./sbt process in the sense that a full IntelliJ refresh will trigger a full recompile in external sbt. So is there a way to not having IntellIJ to compile the main source code on refresh?

from sbt-web-scalajs.

ryan-richt avatar ryan-richt commented on May 26, 2024

For posterity, the offending setting is actually this:

Runtime / managedClasspath += (Assets / packageBin).value

Mentioned by @vmunier long ago on Gitter:

Vincent Munier @vmunier Oct 28 2016 10:14
I think you are referring to using the plugin with Akka HTTP, and thus using this line managedClasspath in Runtime += (packageBin in Assets).value in your config.
It's true that the packageBin operation can take time, but I haven't found another way to include sbt-web assets in an Akka HTTP project.

Long discussion here (unresolved):
sbt/sbt#3578

More here (this is the recommendation from sbt-native-packager docs, but has this problem):
sbt/sbt-native-packager#699

from sbt-web-scalajs.

ryan-richt avatar ryan-richt commented on May 26, 2024

https://github.com/vmunier/akka-http-scalajs.g8#classpath-during-development

Currently testing this ^^^ as the solution. Some suspicion it results in "dirty builds" but still evaluating.

For posterity:

Replace:

Assets / WebKeys.packagePrefix := "public/",
Runtime / managedClasspath += (Assets / packageBin).value

with

lazy val server = project.settings(
...
Assets / WebKeys.packagePrefix := "public/",
Assets / WebKeys.exportedMappings ++= (for ((file, path) <- (Assets / mappings).value)
  yield file -> ((Assets / WebKeys.packagePrefix).value + path)),
...
)

from sbt-web-scalajs.

ryan-richt avatar ryan-richt commented on May 26, 2024

This ^^ indeed solves the IntelliJ issue. We might consider changing this line below to that recommendation (I dont think it has any side effects other than making it "do what you want" in more situations?), but this issue should probably be closed.

Runtime / managedClasspath += (Assets / packageBin).value

from sbt-web-scalajs.

Related Issues (20)

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.