私が数ヶ月前にwebJarsを初めて発見したとき、私は、これらのビルド/ビルドシステムのいくつかの巨大な複雑さを考慮すると、クライアント側の依存関係を処理する実行可能な方法であり、公開されています。第二の懸念は当然確立されていませんでしたが、約36時間を費やして、最初に肯定的に感じています。scss/css/less
タイプのwebJarsと8つのJSウェブジャーナルを1つのjsDependencies
屋根の下に置くことは無駄です。ScalaJs sbtビルドでは、npmまたはbowerの代わりにWebjarsを 'Provided'で使用する利点はありますか?
私はあなたがJSの依存関係3、4、または5に達するまでにそのよう見つけたもの、あなたはとんでもないtimekillループに取得を開始:
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, client:compile, client:compile
[error] - Ambiguous reference to a JS library: bootstrap.js
[error] Possible paths found on the classpath:
[error] - META-INF/resources/webjars/bootstrap3-dialog/1.34.4/examples/assets/bootstrap/js/bootstrap.js
[error] - META-INF/resources/webjars/bootstrap/3.3.6/js/bootstrap.js
[error] originating from: client:compile, client:compile, client:compile, client:compile
2.私は何をすべきか知っています!私は、定義されたjsにバージョンを追加します!
lazy val webjarbs = "org.webjars" % "bootstrap" % version.bootstrap/s"${version.bootstrap}/bootstrap.js" minified s"${version.bootstrap}/bootstrap.min.js" dependsOn "jquery.js" commonJSName "bootstrap"
3.「ああ、いいえ!fastOptJSが失敗しました!」
[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] - Missing JS library: 3.3.6/bootstrap.js
[error] originating from: client:compile, client:compile, client:compile, client:compile
[error] - Missing JS library: 3.3.6/bootstrap.min.js
[error] originating from: client:compile, client:compile, client:compile, client:compile
gg boys。
これは何度もして周りと一周した後、私は
lazy val bs_sidebar = ("org.webjars" % "bootstrap-sidebar" % version.bs_sidebar intransitive())/"js/sidebar.js" dependsOn(s"bootstrap.js", s"bootstrap.min.js")
をやって起動する必要があり、今私は本当にさえwebjarを使用してないんだけど、それはXという名前JS依存関係を持っています私はそれを変更することはできません...
質問
Hmmm?私がやったことをやっただけで、アプリケーションなしで依存ファイルをいくつかの巨大なファイルやファイルのセットにして、それをビルドにフィードするとどうなりますか?私はオンラインからコンセプトの証拠を持っており、私はそれが仕事になった(私はそれがほとんどだったと思うそれはhttps://github.com/wav/material-ui-scalajs-react/blob/master/src/main/scala/wav/web/muiwrapper/package.scalaだった)、そして私にアイデアをくれた。私が知っているnpm
はsbt,
よりもずっと良く動作し、私はまだ私のパッケージにそれを得ることができます...何欠点だ、とは私がSBTについて何かが足りないのですか?
[最近発表されたscalajs-bundler](http://get-scala.org/blog/2016/10/19/scalajs-bundler.html)はこれにどう対応していますか? また、jsDependenciesからnpmDependenciesにマイグレーションする必要がありますか? – Grogs
ほとんどの複雑なビルドは、最終的に 'jsDependencies'よりも原則的なものに移行すると予想されます。 'npmDependencies'は間違いなく1つのオプションです。 – sjrd