gpt4 book ai didi

ScalaJS 简单地将复杂输出重定向到指定目录

转载 作者:行者123 更新时间:2023-12-03 22:53:43 26 4
gpt4 key购买 nike

来自 Scala.js 的 sbt fastOptJS ,我只想重定向 myproject/target/scala-2.11/web-fastopt.jsmyproject/js这可能吗?

同样适用于 web-jsdeps.js - 将其重定向到 /myproject/libs

我读过这个 Scala.js compilation destination

这似乎太复杂了。我只有一个项目,没有两三个,没有播放框架,只是普通的文件到文件夹的副本。

更新:我的设置,project/BuildProject.scala :

 lazy val chromePluginProject = Project(id = "chromePlugin", base = file(".")).enablePlugins(ScalaJSPlugin).

settings(

version := "0.1",
scalaVersion := Versions.scala,

artifactPath in(Compile, fastOptJS) := baseDirectory.value / "plugin" / "src" / "content" / "fastOpt.js",


ivyScala := ivyScala.value map { _.copy(overrideScalaVersion = true) }, // TODO:

//mainClass := Some("branch.ScalaJsSample"),

libraryDependencies ++= scalaJsDependencies,

libraryDependencies += "be.doeraene" %%% "scalajs-jquery" % "0.9.0",
libraryDependencies += "com.lihaoyi" %%% "upickle" % Versions.upickle,

libraryDependencies += "com.lihaoyi" %%% "scalatags" % Versions.scalaTags,

// we will not use use DOM directly so commenting it
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % Versions.dom,


jsDependencies += "org.webjars" % "jquery" % Versions.jquery / "jquery.js",
jsDependencies += "org.webjars.bower" % "webcomponents.js" % Versions.webcomponents / "webcomponents-lite.js",

// After reloading and rerunning fastOptJS,
// this will create scala-js-jsdeps.js
skip in packageJSDependencies := false,

// allows DOM be available from from console' run (so no "ReferenceError: "window" is not defined." error would appear)
jsDependencies += RuntimeDOM, // it will use PhantomJS, basically

scalaJSUseRhino in Global := false //will use node.js to run the thing

)

我的文件结构是: <root>/plugin/src/content我想在哪里复制 fastOpt.js

正如我所说,它在/target/scala-2.11/中的 *-site-jsdeps.js 中创建

最佳答案

是的,你可以这样做:

 artifactPath in(Compile, packageScalaJSLauncher) := baseDirectory.value / ".." / "jvm" / "webapp" / "js" / "launcher.js", 
artifactPath in(Compile, fastOptJS) := baseDirectory.value / ".." / "jvm" / "webapp" / "js" / "fastOpt.js",
artifactPath in(Compile, fullOptJS) := baseDirectory.value / ".." / "jvm" / "webapp" / "js" / "fullOpt.js",
artifactPath in(Compile, packageJSDependencies) := baseDirectory.value / ".." / "jvm" / "webapp" / "js" / "dependency.js"

更多,您可以引用https://github.com/yuanqingfei/gdbscan-akka-d3js/blob/master/build.sbt

关于ScalaJS 简单地将复杂输出重定向到指定目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37127313/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com