Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 11 09:15
    vhiairrassary edited #390
  • Jan 11 08:31
    vhiairrassary commented #287
  • Jan 11 08:29
    vhiairrassary opened #392
  • Jan 10 10:01
    vhiairrassary commented #389
  • Jan 10 09:43
    vhiairrassary commented #389
  • Jan 10 09:42
    vhiairrassary opened #391
  • Jan 09 12:28
    sjrd commented #389
  • Jan 09 08:58
    vhiairrassary commented #350
  • Jan 09 08:58
    vhiairrassary commented #350
  • Jan 09 08:57
    vhiairrassary commented #350
  • Jan 09 08:57
    vhiairrassary commented #350
  • Jan 09 08:56
    vhiairrassary opened #390
  • Jan 09 08:31
    vhiairrassary commented #389
  • Jan 08 16:33
    vhiairrassary closed #312
  • Jan 08 16:33
    vhiairrassary commented #312
  • Jan 08 16:13
    vhiairrassary opened #389
  • Jan 07 17:01
    adpi2 commented #385
  • Jan 06 11:44
    scala-steward synchronize #367
  • Jan 06 11:02

    sjrd on master

    Update jimfs to 1.2 Merge pull request #388 from sc… (compare)

  • Jan 06 11:02
    sjrd closed #388
Binh Nguyen
@ngbinh
@nafg ah ok, thanks
nafg
@nafg
@ngbinh see above conversation
Binh Nguyen
@ngbinh
The PR to support scala.js 1.3.0 is already merged in scalajs bundler master. I probably can fetch and publish a private version my own but wondering if a new version should be cut soon
Sébastien Doeraene
@sjrd
Yes, today.
Binh Nguyen
@ngbinh
awesome! Thanks
Sébastien Doeraene
@sjrd
I have published 0.20.0 with support for Scala.js 1.3.0.
Carlos Quiroz
@cquiroz
@sjrd Thanks a lot, seems to be working fine
Carlos Quiroz
@cquiroz
Are you planning to add support to multiple modules or is it something for community contributions?
Sébastien Doeraene
@sjrd
A community contribution would be most welcome :) I unfortunately have a zillion other things to do.
nafg
@nafg
It would be nice if the npmDependencies -> package.json stuff were a separate plugin from the bundling stuff
Sébastien Doeraene
@sjrd
Yes, that too. At least a separate AutoPlugin, even if in the same artifact at the beginning.
Dan Di Spaltro
@dispalt
yeah agreed and good point
Carlos Quiroz
@cquiroz
I guess it is basically making it produce the scalajs.webpack.js file to a given dir
nafg
@nafg
@cquiroz wdym
unarist
@unarist
looks like release notes are not pushed to the website?
Jason Pickens
@steinybot
Any idea why I’m guessing weird relative paths in my source map? Such as:
[error] Module Warning (from ./node_modules/scalajs-friendly-source-map-loader/index.js):
[error] (Emitted value instead of an instance of Error) Cannot find source file '../../../../../../../../../home/nick/Forks/scala.rx/scalarx/shared/src/main/scala/rx/Ctx.scala': Error: Can't resolve '../../../../../../../../../home/nick/Forks/scala.rx/scalarx/shared/src/main/scala/rx/Ctx.scala' in '/Users/jason/source/erp/erp-front/target/scala-2.12/scalajs-bundler/main’
Where is /home/nick/ even coming from? Possibly related to scalacenter/scalajs-bundler#173. Maybe I ought to ask in the scalajs channel.
Sina
@sinaghaffari
Hi everyone. I'm having a lot of trouble figuring out how to bundle things like fonts using scalajs-bundler. I'm using scalacss to define font-faces which have "url(...)"s in them. I've tried a bunch of different things, but can't seem to get scalajs-bundler to actually recognize that the fonts are being referenced and including them within the bundle
Carlos Quiroz
@cquiroz
You probably need to specify a font loader on your webpack configuration
If the url is to some external site it should just work
Sina
@sinaghaffari
The url is to a local directory relative to the scala file
so something like ../../../../public/fonts/My-Font.eot
I defined a file-loader in my webpack config
Sina
@sinaghaffari
Im actually not sure if the url should be relative to the .scala source file, or the compiled js file, or the bundled js file
Carlos Quiroz
@cquiroz
that’s tricky, it has to be relative to the bundled file
but I’ve used aliases pointing to a resources dir
Sina
@sinaghaffari
I gave up and used an external url :(
I figure that the same server that's serving the JS will serve the font, so there wont be any problems there
Carlos Quiroz
@cquiroz
e..g.
const resourcesDir = path.resolve(rootDir, "../common/src/main/resources”);
and then I need to add tha to the search dir
  resolve: {
     alias: {
       resources: resourceDir
That lets you refer on you import something like resources/fonts/etc
Domantas Petrauskas
@dope9967
Hi, maybe there's some example project on how to make sbt-web-scalajs-bundler work with akka http? I tried adapting Play example, but somethings missing - assets do not seem to link up in classpath, I'm guessing Play provides some helpful settings under the hood and Akka doesn't.
Domantas Petrauskas
@dope9967
Or maybe I have more of a sbt-web issue, because Scala.js bundle does appear in server module's /target
Domantas Petrauskas
@dope9967
Just for reference, my issue is with simply with IntelliJ - sbt run or sbt ~reStart work just fine
Julien Richard-Foy
@julienrf
@dope9967 Maybe this is an issue with IntelliJ then?
Domantas Petrauskas
@dope9967
@julienrf yes, maybe I didn't phrase this most correctly, but my last message was to just note that the issue is "solved" - it's IntelliJ's classpath issue, not related to this plugin. Though it works both from sbt shell and sbt Run/Debug configurations, issue arises when server is ran as simple application from the main class through Run/Debug configurations, so it's not completely unusable, just got to fallback to sbt everywhere.
Adrien Piquerez
@adpi2
Hi! I have a .jpeg file in src/main/resources and I would like it to be bundled when I run fastOptJS / webpack. I guess that file should be automatically copied to target/scala-2.13/scalajs-bundler/mainbut how can I do that properly?
Julien Richard-Foy
@julienrf
Hello, it should not be in src/main/resources but in src/main/js
Then you also need to configure webpack to use an image loader
Adrien Piquerez
@adpi2
Cool thanks! That worked!
Jasper Denkers
@jasperdenkers
Hi, I'm working on a setup similar to the js-source-directory test, i.e., including some Javascript sources at src/main/js. While this works fine on the first compilation, changes to the Javascript sources are not picked up by fastOptJS::webpack. I tried adding webpackMonitoredDirectories += sourceDirectory.value / "js", but that didn't help. Would it be possible to have fastOptJS::webpack automatically detect changes to Javascript sources and retrigger webpack bundling if changes are detected?
Jasper Denkers
@jasperdenkers
Based on the SBT docs on tracking file inputs and outputs I tried fastOptJS / fileInputs += sourceDirectory.value.toGlob / "js" / "*.js", but that also didn't help. Maybe I'm misunderstanding SBT internals here?
lazno
@lazno

Hello. I just made the switch from 0.6.x to 1.3.1. I am struggling with getting our build to work again. I hope I can get help here.

We are using ScalaJS with the sbt-web-scalajs-bundler for a small SPA. In 0.6 we imported some static files located in our resource folder like this

@js.annotation.JSImport("resources/Main.scss", js.annotation.JSImport.Default)

which worked fine. After upgrading, webpack complains, that there is no loader defined for our sass files, although we have it in place (as we did before):

[error] Module parse failed: Unexpected character '@' (1:0)
[error] You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file.[...]
resolve: {
    alias: {
      'resources': path.resolve(__dirname, '../../../../src/main/js'),
    },
    modules: [path.resolve(__dirname, 'node_modules')]
},
module: {
    rules: [
     {
        test: new RegExp("\\.scss$"),
        use: [
          // Creates `style` nodes from JS strings
          'style-loader',
          // Translates CSS into CommonJS
          'css-loader',
          // Compiles Sass to CSS
          'sass-loader',
        ],
    }
  ]
 },

Also the source-map-loader emits warnings about not finding the scala sources.

[warn] Module Warning (from ./node_modules/source-map-loader/index.js):
[...]
[warn] NonErrorEmittedError: (Emitted value instead of an instance of Error) Cannot find source file[...]

I guess i am missing something basic here?

Sébastien Doeraene
@sjrd
Did you upgrade to 0.6.33 first, and addressed all the deprecation warnings, and made your build work that way?
Then, did you upgrade scalajs-bundler to 0.19, and made your build work that way?
If yes, then from there we can talk about upgrading to Scala.js 1.3.1 and scalajs-bundler 0.20 (at the same time).
lazno
@lazno
Hi Sebastien.
we were on 0.6.33 with sbt-web-scalajs-bundler-sjs06 0.18.0 and no deprecation warnings
I now verified that 0.19.0 also didn't cause any deprecation warnings
Sadly I am forced to do the jump straight to 1.3.1 since one of our dependencies was only published for that version. And from what I understand the bundler only supports scalajs 1.3.1 from version 0.20 onward
lazno
@lazno

i think the problem lies somewhere in the way our folder structure is configured. our client application is located in a "client" subproject
projectroot/client

and the folder layout in there is as follows
projectroot/client/src/main/js
projectroot/client/src/main/scala
projectroot/client/webpack
projectroot/client/public

and this is the config in build.sbt to reflect that layout

   webpackResources := baseDirectory.value / "webpack" * "*",
    webpackConfigFile in fastLinkJS := Some(baseDirectory.value / "webpack" / "webpack-fastopt.config.js"),
    webpackConfigFile in fullLinkJS := Some(baseDirectory.value / "webpack" / "webpack-opt.config.js"),
    webpackConfigFile in Test := Some(baseDirectory.value / "webpack" / "webpack-core.config.js"),
    webpackDevServerExtraArgs in fastLinkJS := Seq("--inline"),
    webpackBundlingMode in fastLinkJS := BundlingMode.LibraryOnly(),

i succeeded in making the whole thing compile when i change the above to use fullOptJS and fastOptJS instead of the linker version. which i don't quite understand to be honest, since to documentation states to use the fast/fullLinkJS in the newest versions.

i still get the sourcemap warnings though