Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jan 11 18:19

    github-actions[bot] on gh-pages

    Deploying to gh-pages from @ b… (compare)

  • Jan 11 18:17

    julienrf on main

    Rename master to main (compare)

  • Jan 11 18:06
    julienrf closed #281
  • Jan 11 18:06

    julienrf on master


  • Jan 11 18:06

    julienrf on main


  • Jan 07 21:28
    Karasiq opened #411
  • Dec 05 2021 07:40
    julienrf commented #293
  • Dec 04 2021 19:38
    Lasering commented #293
  • Nov 24 2021 05:50
    unarist commented #350
  • Nov 23 2021 00:22
    evbo commented #350
  • Nov 23 2021 00:03
    evbo commented #350
  • Nov 22 2021 22:48
    ngbinh commented #359
  • Nov 22 2021 19:14
    evbo commented #359
  • Nov 20 2021 18:10
    bblfish commented #350
  • Nov 20 2021 18:10
    bblfish commented #350
  • Nov 04 2021 15:24
    mkotsbak commented #359
  • Oct 24 2021 00:47
    scala-steward opened #410
  • Oct 12 2021 08:26
    armanbilge opened #409
  • Oct 05 2021 12:17
    Jaystified commented #350
  • Oct 04 2021 00:33
    ansvonwa commented #402
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?

Maxime P

Hi there, using the bundler for the first time this week and ran against some warnings when sharing a module between a Play server and a scala.js client. This shared module has a dependency (play-json-derived-codecs), here is what I see :

[warn] WARNING in ./client-fastopt.js
[warn] Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
[warn] Failed to parse source map from '/home/runner/work/play-json-derived-codecs/play-json-derived-codecs/library/src/main/scala/julienrf/json/derived/DerivedOWrites.scala' file: Error: ENOENT: no such file or directory, open '/home/runner/work/play-json-derived-codecs/play-json-derived-codecs/library/src/main/scala/julienrf/json/derived/DerivedOWrites.scala'

Is there anything obvious that I'm missing in my build.sbt? (I can try to share a minimal version to reproduce). Thanks