本文介绍了Scala.js CSS依赖项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试让Scala.js使用引导程序库。
添加js文件很简单直接:
I'm trying to get Scala.js working with the bootstrap library.Adding the js file was easy and straight forward:
jsDependencies +="org.webjars" % "bootstrap" % "3.3.7-1" / "bootstrap.js" minified "bootstrap.min.js"
但是现在我添加bootstrap.css文件时遇到了问题。
我试过这一行:
But now I've problems to add the bootstrap.css file.I tried this line:
"org.webjars" % "bootstrap" % "3.3.7-1" / "bootstrap.css" minified "bootstrap.min.css"
但是将css文件添加到 jsDependencies
似乎不起作用:
But adding a css file to the jsDependencies
doesn't seem to work:
[error] (frontend/compile:resolvedJSDependencies) org.scalajs.core.tools.jsdep.JSLibResolveException: Some references to JS libraries could not be resolved:
[error] - Missing JS library: bootstrap.min.css
[error] originating from: frontend:compile
[error] - Missing JS library: bootstrap.css
[error] originating from: frontend:compile
有人能告诉我如何正常工作吗?
Can anybody tell me how to get this working properly?
推荐答案
能够将CSS注入您的HTML页面。您可能需要查看,一个scala-js webpack包装器。
Weppack is able to inject CSS into your HTML page. You might want to look at scalajs-bundler, a scala-js webpack wrapper.
这篇关于Scala.js CSS依赖项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!