Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Nov 24 05:50
    unarist commented #350
  • Nov 23 00:22
    evbo commented #350
  • Nov 23 00:03
    evbo commented #350
  • Nov 22 22:48
    ngbinh commented #359
  • Nov 22 19:14
    evbo commented #359
  • Nov 20 18:10
    bblfish commented #350
  • Nov 20 18:10
    bblfish commented #350
  • Nov 04 15:24
    mkotsbak commented #359
  • Oct 24 00:47
    scala-steward opened #410
  • Oct 12 08:26
    armanbilge opened #409
  • Oct 05 12:17
    Jaystified commented #350
  • Oct 04 00:33
    ansvonwa commented #402
  • Oct 01 08:59
    mathieuleclaire commented #59
  • Aug 17 16:31
    giabao synchronize #408
  • Aug 17 15:54
    giabao opened #408
  • Aug 14 15:48
    garhirunrat commented #2
  • Aug 08 20:10
    zoombinis commented #406
  • Aug 08 17:09
    zoombinis commented #406
  • Aug 02 14:09
    sjrd edited #407
  • Aug 02 14:04
    sjrd labeled #407
Thanks @cquiroz. I've tried out 0.21.0-RC1 with Webpack5. I'm getting this issue on both fastOptJs and fullOptUs: scalacenter/scalajs-bundler#338. I don't have this problem with 0.20.0 and webpack4.
Also, does 0.21.0-RC1 support fastLinkJS and fullLinkJs now?
Ashkan Kh. Nazary
Hello everyone :wave: following the docs I'm getting an error about this new "0.0.0+1-d083e6df-SNAPSHOT" ... the old one (0.20.0) works fine though:
[error] (update) sbt.librarymanagement.ResolveException: Error downloading ch.epfl.scala:sbt-scalajs-bundler;sbtVersion=1.0;scalaVersion=2.12:0.0.0+1-d083e6df-SNAPSHOT
[error]   Not found
[error]   Not found
[error]   not found: https://repo1.maven.org/maven2/ch/epfl/scala/sbt-scalajs-bundler_2.12_1.0/0.0.0+1-d083e6df-SNAPSHOT/sbt-scalajs-bundler-0.0.0+1-d083e6df-SNAPSHOT.pom
[error]   not found: /Users/ashkan/.ivy2/local/ch.epfl.scala/sbt-scalajs-bundler/scala_2.12/sbt_1.0/0.0.0+1-d083e6df-SNAPSHOT/ivys/ivy.xml
[error]   not found: https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/ch.epfl.scala/sbt-scalajs-bundler/scala_2.12/sbt_1.0/0.0.0+1-d083e6df-SNAPSHOT/ivys/ivy.xml
[error]   not found: https://repo.typesafe.com/typesafe/ivy-releases/ch.epfl.scala/sbt-scalajs-bundler/scala_2.12/sbt_1.0/0.0.0+1-d083e6df-SNAPSHOT/ivys/ivy.xml
[warn] Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? (default: r)
one probable pointer is the scala version in the error message (2.12) while I'm using 2.13.6 everywhere !
Carlos Quiroz
I think you need to try 0.21.0-RC1
It is 2.12 as sbt plugin all use scala 2.12
Colin Yates
morning all - newb, but how do I configure scalajs-bundler to execute SCSS and optimise the images/CSS (e.g. create an image sprite/rewrite CSS). I know "use webpack" :-) but I've not had enough coffee and failing to see how to plug that in. This is such a common usecase - do you know of any public examples? Thanks!
Nigel Rantor
On the off-chance that my google-fu just fails me I have a question. I know that the scalajs-bundler system doesn't deal with HTML/assets. I am wondering if there is an all-in-one SBT plugin that does deal with this though, probably using scalajs-bundler under the covers for the JS library part. I have been looking for a while now after getting to the stage where I really want my dev env to have a quicker cycle time and I'm no closer to seeing anything.
3 replies
Sébastien Doeraene
1 reply

Hi, love this lib! Trying to implement code splitting using Webpack's "magic comments" but are all comments getting stripped away by scalajs optimization before webpack sees them?


oh... maybe this isn't supported yet?: scalacenter/scalajs-bundler#2

Hi, I too am curious, is it possible to code split?

My electron app built with scalajs bundler is getting slow to load, I need to code split so imports are gradually made.

Any way forward on code splitting?

You can code split in scala.js but it is not supported by scalajs-bundler

thanks @cquiroz:matrix.org , so then the only option I presume is to separate "modules" by different sbt subprojects - each one running scalajs bundler separately?

If that is the only workaround, how then do I reference the individually bundled so that my "main" subproject is able to progressively load them?

off the top of my head, I know how to tell sbt to go fetch files out of target directories, so i could manually grab the bundled modules, and then I presume my webpack config for the "main" subproject would need to say: also include these bundled js files?
I’m doing without using scalajs-bundler actually, I just generate the modules with sbt and then use vite to the “bundlinG” though that’s not really the correct concept for vite
@cquiroz:matrix.org very cool. Do you have any OSS you can share that uses that approach?
You can see the demo part of this facade

very cool, so you run scalajsbunder as usual and then from inside the scalajs bundler/main folder underneath target you simply run npm buildand that triggers your vite build?

If that's all there is to it that's way simpler than creating separate subprojects!


curious, why does scalajsbundler output everything into just a "main" folder? I'm working with Tauri, and it expects code layout something along the lines of:

./dist    <- all bundled js/assets in here

Is there a way or interest in supporting configuration for a dist folder separate from package.json? A flat layout unfortunately leads to buggy behavior so I am generating this layout manually with a script after running scalajs bundler

e.g., here is my manual approach after bundling:
  cd client/target/scala-2.13/scalajs-bundler/main/ && \
  mkdir --parents ./build &&
  rsync --archive --human-readable --progress --remove-source-files \
    --exclude=build \
    --exclude=node_modules \
    --exclude=package*json \
    --exclude=webpack \
    * ./build/
Simon Parten
I'm getting this message from a project with scala JS bundler...
Unsupported webpack major version 4
4 replies
addSbtPlugin("ch.epfl.scala"               % "sbt-scalajs-bundler"      % "0.20.0")
This message was deleted
Alexis Hernandez
Quick question about the plugin directories, right now, I'm depending on some files that are pulled from npm, I had to hardcode the directory but there is likely a way to get it from the scalajs-bundler plugin, I started looking to the source code but I'm posting just in case someone has the answer:
(ThisBuild / baseDirectory).value / "target" / "scala-2.13" / "scalajs-bundler" / "main" / "node_modules" / "custom-protos"
Alexis Hernandez
After playing a bit with it, I wasn't able to get the full path from a value, while the npmInstallDependencies task returns the node_modules directory, I need the directory as an input for a Setting, a Setting can't depend on a Task, hence, I ended up writing this:
(npmUpdate / crossTarget).value / "scalajs-bundler" / "main" / "node_modules" / "custom-protos"
Fabrice Sznajderman
Hi All
I have, probably, a basic question .. I'm wondering if there is a possibility to change the output directory where the main.js is putted? Many thanks for your help
2 replies
Julien Richard-Foy
Hello! It seems the website shows a wrong version number for scalajs-bundler: 0.0.0+1-d083e6df-SNAPSHOT

using the latest release 0.21.0-RC1, I try to use webpackBundlingMode in fastOptJS set to LibraryOnly

But then only *-fastopt-library.js is emitted and not *-loader.js or *-fastopt.js?

I can work around this by disabling LibraryOnly, but how can I enable it while also emitting those others as it worked in 0.20.0?