scalajs-bundler

Facing ReferenceError while running tests with ScalaJS Bundler

青春壹個敷衍的年華 提交于 2021-01-28 08:47:36
问题 I am facing this issue when upgrading from sbt-scalajs 0.6.x to 1.2.0 and the issue is:- With sbt-scalajs v0.6.26 (and sbt-scalajs-bundler v0.14.0 ), I have enabled the jsdom support for tests: requireJsDomEnv in Test := true And test suites are running fine. But with sbt-scalajs v1.2.0 (and sbt-scalajs-bundler v0.18.0 ), I have enabled the jsdom support for tests too: requireJsDomEnv in Test := true But this is giving me the following error: [info] Writing and bundling the test loader

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

爷,独闯天下 提交于 2020-01-16 09:07:08
问题 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? 回答1: Currently, all the .js files on the classpath are eligible to be bundled. This is why your i18n.js file is included in the resulting bundle. Note, however, that it is not planned to continue to support this behavior (relying on .js files on the

How to use scalajs-bundler with client only app

こ雲淡風輕ζ 提交于 2020-01-15 11:13:34
问题 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 example: Add into build.sbt: npmDependencies in Compile += "esprima" -> "3.1.3" Add into Main.scala: import Esprima._ import JsonToString._ val code = "answer = 42" val tokens = tokenize(code) val tokensStr = tokens.json Change in Main.scala : "This is

How to use JSImport when writing scalajs facade for javascript modules

谁都会走 提交于 2019-12-12 23:12:31
问题 I have written a facade using JSImport, and it works. Unfortunately, I arrived at the solution through trial and error, and I don't fully understand why this particular solution works but others I tried did not. Background: I'm starting with a working project, built with sbt, which is a single page application that implements the client side code with scala.js and the server side with scala and the Play framework. The javascript libraries were packaged with web jars and bundled into the

Can JSweet viably port Java libraries for use in cross-built Scala.js projects?

你说的曾经没有我的故事 提交于 2019-12-11 00:31:43
问题 In the search for ways to make Java libraries accessible to both the JavaScript and JVM sides of Scala.js cross-built projects, please consider the following experiment: Imagine that a Scala.js project needs advanced matrix math capabilities such as Singular Value Decomposition. Although the JavaScript world has Numeric.js and the JVM world has many options, JAMA not least among them, no cross building Scala.js solution exists at the time of this question's formulation. What options do we