When using fastOptJS::webpack the produced fastopt.js file has the permision rw------- (only user readable and writable). Anything else under target tends is generally world and group readable (rw-r--r--), so this specific file seem to be an exception.
In a development use case, there is an nginx docker container that has target/scala-2.13/scalajs-bundler/main available to it as a volume so it can serve files produced by the host. Due to this, nginx (which runs as different non-root user), can't access the file.
My workaround has been to add the following to my build:
Compile / fastOptJS / webpack := {
val result = (Compile / fastOptJS / webpack).value
result.foreach {
(af: Attributed[File]) =>
IO.chmod("rw-r--r--", af.data)
}
result
}
When using
fastOptJS::webpack
the producedfastopt.js
file has the permisionrw-------
(only user readable and writable). Anything else undertarget
tends is generally world and group readable (rw-r--r--
), so this specific file seem to be an exception.In a development use case, there is an nginx docker container that has
target/scala-2.13/scalajs-bundler/main
available to it as a volume so it can serve files produced by the host. Due to this, nginx (which runs as different non-root user), can't access the file.My workaround has been to add the following to my build: