Comments (4)
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.
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.
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.
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.
from sbt-web-scalajs.
Related Issues (20)
- Scala 3 compatibility HOT 1
- Can't set scalaJSStage for configurations other than Global HOT 2
- Getting build artifacts in right folder / replacement for isDevMode
- Build error when plugin is use together with newer play framework versions (>=2.9) HOT 2
- v1.3.0 no such method error on SbtWeb$.withActorRefFactory
- Class not found exception
- add HOT 1
- Using sbt-web-scalajs with single-project build HOT 3
- Have client-opt.js and client-launcher.js in the same file. One request less means a lot. HOT 2
- Support source map with absolute path (IntelliJ debugging problem)
- Publish for sbt 1.0.0-RC2? HOT 6
- Not compatible with ScalaJs 1.0.0-M1 HOT 17
- sbt-web-scalajs is breaking idempotent SBT contract HOT 4
- Specify opt js output file name HOT 3
- Dev mode detection does not always work HOT 4
- devCommands is still too strict: It misses ~ HOT 7
- Source map files (.map) should not been present inside JAR when using prod commands
- Can't make the current version sbt-web-scalajs 1.1.0 to work properly HOT 1
- error: not found: value devCommands HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-web-scalajs.