Questions tagged [scalajs-bundler]

Questions related to scalajs-bundler.

is a module bundler for projects that use packages.

You can find more information on the GitHub repo : https://scalacenter.github.io/scalajs-bundler/

38 questions
1
vote
1 answer

scalajs and webpack4 config settings issues

I am using webpack 4.20.2 and scalajs ("0.6.24") , scalajs bundler(0.13.1) when i am building bundle file i am getting below webpack exceptions. I am attaching build.sbt which uses webpack.config.dev.js and generate scalajs-webpack.config.js . If i…
donald
  • 478
  • 8
  • 19
1
vote
1 answer

In Scala.js facades, why does the @js.native annotation preclude the @JSExport one?

Please consider a Scala.js library with a native dependency implemented as pure JavaScript CommonJS module. The library includes a facade for the JavaScript dependency. As expected, the facade includes a lot of code like: @JSImport("com", "Foo")…
Ben McKenneby
  • 481
  • 4
  • 15
1
vote
2 answers

scalajs-bundler: which compiled file should be included in HTML?

I'm trying to handle my JS dependencies with scalajs-bundler for my Scala.js project. It successfully downloads my dependency (d3.js), but I don't know how to include my code and the dependency in my HTML file. I tried every files I found on…
1
vote
1 answer

TypeError: Cannot read property 'freeze' of undefined

I am trying to create a facade for the npm library avsc. When I compile with sbt fastOptJS::webpack and open the .html file, I get Uncaught TypeError: Cannot read property 'freeze' of undefined from the file treepad-fastopt-bundle.js in the line…
Tamriel
  • 1,337
  • 1
  • 9
  • 9
1
vote
1 answer

How to use scalajs-bundler with client only app

In another question I was advised to use ScalaJS bundler to import NPM dependencies. I would like to use some Javascript NPM packages in a simple client-only web application. There is an example called static which shows this. My changes to the…
Suma
  • 33,181
  • 16
  • 123
  • 191
1
vote
1 answer

New Scala.js facade for Three.js -> "Cannot find module "THREE""

As https://github.com/antonkulaga/threejs-facade is heavily outdated I tried an approach like: https://github.com/Katrix-/threejs-facade and would like to create a facade for the new three.js library. I am by no means a JS expert, nor am I a…
user4063815
0
votes
1 answer

Exception using scalajs-bundler Reference to undefined setting: client / npmDependencies

I get the following exception when i start sbt: [error] Reference to undefined setting: [error] [error] client / npmDependencies from client / npmDependencies (/home/sofoklis/workspace/playjs/build.sbt:26) [error] Did you mean client /…
Sofoklis
  • 21
  • 2
0
votes
1 answer

Is ScalaJS v1.2.0 compatible with IE 11?

I have a project built using ScalaJS version 1.2.0 and testing the JS built with IE 11, but it is not working. Is assumingES6: true a problem? As it was set to false in ScalaJS version 0.6.x. If yes, then how can we set assumingES6: false in ScalaJS…
himanshuIIITian
  • 5,985
  • 6
  • 50
  • 70
0
votes
1 answer

How can you make a client-side javascript pages with scala.js and sbt's ScalaJSBundler?

I'm using scala.js to create javascript code to be run in a browser, served up by an akka-http server. I had it mostly working using mill as my build tool, but then wanted to switch to sbt so I could use the ScalaJSBundler plugin for npm…
0
votes
1 answer

Importing assets from an NPM Package

Say I want to include font-awesome in my webapp. So I define my build.sbt as follows: val commonSettings = Seq( name := "repro", version := "1.0", scalaVersion := "2.12.8", unmanagedSourceDirectories in Compile += …
user79074
  • 4,937
  • 5
  • 29
  • 57
0
votes
1 answer

Getting "jQuery is not defined" when using a library that depends on it

I am trying to use the bootstrap input spinner in my scalajs app. But when I try to use it I am getting the error "jQuery is not defined", even though I have included it in my project. Can someone tell me what I am missing? So if I define a…
user79074
  • 4,937
  • 5
  • 29
  • 57
0
votes
1 answer

How to use jquery-ui with JSImport

I want to access the jquery ui library in my scala js project. I have tried defining the following main module: import org.scalajs.jquery.JQueryStatic import scala.scalajs.js import org.scalajs.dom import scalatags.JsDom.all._ import…
user79074
  • 4,937
  • 5
  • 29
  • 57
0
votes
1 answer

How does webpack determine which files/folders it will include in a bundle

I have a set of files in my project's src/main/resources folder - such as index.html, myproject.css, i18n.js When I run webpack only one file is automatically copied over to the bundle, namely 118n.js. Why does this get bundled but nothing else?
user79074
  • 4,937
  • 5
  • 29
  • 57
0
votes
0 answers

Add a task to copy files from my resources folder to a target

I have a scala js project that uses the sbt-scalajs-bundler plugin. When I run the webpack command most of the necessary files are bundled to the target/scala-2.12/scalajs-bundler/main folder. I have placed my html resources (such as index.html,…
user79074
  • 4,937
  • 5
  • 29
  • 57
0
votes
0 answers

PlotlyJS with ScalaJS: Problem with 3D graph / WebGL

With plain Javascript it works: var data = [{ "z": [[8.83, 8.89, 8.81, 8.87, 8.9, 8.87], [8.89, 8.94, 8.85, 8.94, 8.96, 8.92], ..., [8.93, 8.97, 8.97, 9.18, 9.2, 9.18]], "type": "surface" }]; var layout = {}; var…
pme
  • 14,156
  • 3
  • 52
  • 95