2017-05-30 12 views
2

でスクリプトを起動...アプリのクロスビルドアプローチを使用して:ScalaJSのfastOptJSとSBT-ネイティブパッケージャ

<root folder> 
- client 
- project 
- server 
- shared 
- build.sbt 

それは今sbt re-startまたはsbt run-main WebServer を実行している正常に動作しますsbt-native-pagkagerプラグイン私はすべてのものをパッケージ化し、私のプロジェクトのスタートスクリプトを生成したいと思います。

開始スクリプトの生成は機能しますが、ScalaJS fastOptJsは含まれていないようです。

hereが助けてくれるものがありますが、私の場合は間違いありません。

ところで、私のbuild.sbtファイルは次のようになります。

val scalaV = "2.12.2" 

lazy val server = (project in file("server")) 
    .settings(
    scalaVersion := scalaV, 
    scalaJSProjects := Seq(client), 
    pipelineStages in Assets := Seq(scalaJSPipeline), 
    // triggers scalaJSPipeline when using compile or continuous compilation 
    compile in Compile := ((compile in Compile) dependsOn scalaJSPipeline).value, 
    libraryDependencies ++= Seq(
     ... 
    ), 

    WebKeys.packagePrefix in Assets := "public/", 
    (managedClasspath in Runtime) += (packageBin in Assets).value, 
    // Packaging 
    topLevelDirectory := None // Don't add a root folder to the archive 
) 
    .enablePlugins(SbtWeb, JavaAppPackaging) 
    .dependsOn(sharedJvm) 

lazy val client = (project in file("client")) 
    .settings(
    scalaVersion := scalaV, 
    scalaJSUseMainModuleInitializer := true, 
    unmanagedSourceDirectories in Compile := Seq((scalaSource in Compile).value), 
    libraryDependencies ++= Seq(
    ... 
    ), 
    jsDependencies ++= Seq(
    ... 
) 
) 
.enablePlugins(ScalaJSPlugin, ScalaJSWeb) 
.dependsOn(sharedJs) 

lazy val shared = (crossProject.crossType(CrossType.Pure) in file("shared")) 
    .enablePlugins(BuildInfoPlugin) 
    .settings(
    scalaVersion := scalaV, 
    libraryDependencies ++= Seq(
     ... 
    ), 
    // build info 
    buildInfoOptions += BuildInfoOption.BuildTime, 
    buildInfoKeys := Seq[BuildInfoKey](
    ), 
    buildInfoPackage := "com.example.build" 
) 
    .jsSettings(
    libraryDependencies ++= Seq(
     ... 
    ) 
) 
.jsConfigure(_ enablePlugins ScalaJSWeb) 

.... 

任意のヘルプ?どうもありがとう!

答えて

0

My fault!

私は右のJavaScriptファイル( クライアントjsdeps.min.jsとクライアントopt.jsが)それは今も元気に動作stage

を使用して生成された私のHTMLテンプレート内参照していませんでした!

関連する問題