通過Scala.js'sbt fastOptJS
,我只是想將myproject/target/scala-2.11/web-fastopt.js
重定向到myproject/js
是可能的嗎?ScalaJS簡單地將複雜度輸出重定向到指定的目錄
同爲web-jsdeps.js
- 將其重定向到/myproject/libs
我讀過這個 Scala.js compilation destination
,這似乎太複雜了。我只有一個項目,而不是兩個或三個,沒有播放框架,只是簡單的文件到文件夾副本。
UPDATE: 我的設置,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
正如我所說的它會在*上門,jsdeps .js in /target/scala-2.11/
似乎現在對我有用,我試圖把它放在.settings(..)或項目之外。我也試過這個:http://stackoverflow.com/questions/27505957/using-scala-js-to-compile-only-and-not-override-run-in-sbt eventhough再次有兩個項目。 – ses
'crossTarget in(Compile,fastOptJS)'然後呢? – sjrd
nope。更新了我的問題。 – ses