Tag: scala.js

在scala-js中使用definitelyscala节点外观的正确方法是什么?

有一些基本的东西,我错过了使用scala-js的外观。 显然,这是错误的: package foo.webapp import com.definitelyscala.node.util.Util import scala.scalajs.js.JSApp object FooApp extends JSApp { override def main(): Unit = { Util.debug("debug") } } 因为我得到: [error] TypeError: Cannot read property 'debug' of undefined 什么是正确的方法来做到这一点? 非常感谢!

无法运行scalajs-react项目

我只是试图build立scalajs -使用官方文档 做出反应 ,但是当我尝试运行这个sbt run时遇到了一个问题: [info] Fast optimizing C:\temp\scalajs-react\target\scala-2.12\scala-js-tutorial-fastopt.js [info] Running org.example.TutorialApp [error] module.js:471 [error] throw err; [error] ^ [error] [error] Error: Cannot find module 'react' [error] at Function.Module._resolveFilename (module.js:469:15) [error] at Function.Module._load (module.js:417:25) [error] at Module.require (module.js:497:17) [error] at require (internal/module.js:20:19) [error] at C:\Users\avkar\AppData\Local\Temp\1484704765073-0\react-dom.js:16:24 [error] at Object.<anonymous> (C:\Users\avkar\AppData\Local\Temp\1484704765073-0\react-dom.js:40:3) [error] at Module._compile (module.js:570:32) [error] at […]

如何从scala.js调用nodejs模块?

我正在尝试使用scala.js + nw.js来编写一些应用程序,并将在scala.js中使用一些节点模块。 但我不知道该怎么做。 说,有模块fs ,我可以用Javascript编写这样的代码: var fs = require('fs'); fs.writeFile("/tmp/test", "Hey there!", function(err) { if(err) { console.log(err); } else { console.log("The file was saved!"); } }); 但是如何在scala.js中从头开始呢?

在ScalaJs sbt构build中,使用webjars而不是npm或者bower与'Provided'有什么优势?

当我几个月前第一次发现webjars时,我非常怀疑,考虑到这些构build/构build系统的巨大复杂性,考虑到发布js文件的频率,这将成为处理客户端依赖的一种可行方式。 第二个问题当然是没有根据的,但是我花了将近36小时徒劳地试图获得大约10个scss/css/lesstypes的webjars和8个JS webjars,在一个jsDependencies屋顶下生活。 当你到达JS依赖关系3,4或者5时,我发现,你开始进入一个荒谬的时间循环: 1.“哦,没有!fastOptJS失败,因为有一些随机文件也被命名为相同的在webjar! [trace] Stack trace suppressed: run last client/compile:resolvedJSDependencies for the full output. [error] (client/compile:resolvedJSDependencies) org.scalajs.core.tools.jsdep.JSLibResolveException: Some references to JS libraries could not be resolved: [error] – Ambiguous reference to a JS library: bootstrap.min.js [error] Possible paths found on the classpath: [error] – META-INF/resources/webjars/bootstrap/3.3.6/js/bootstrap.min.js [error] – META-INF/resources/webjars/bootstrap3-dialog/1.34.4/examples/assets/bootstrap/js/bootstrap.min.js [error] originating from: client:compile, client:compile, […]