【问题标题】:Include minified JavaScript files in war在战争中包含缩小的 JavaScript 文件
【发布时间】:2012-08-11 05:18:52
【问题描述】:

我正在使用 sbt-js 0.3 构建一个 Scalatra Web 项目。我在build.sbt 中包含了以下几行。

(webappResources in Compile) <+= (resourceManaged in Compile)

(resourceGenerators in Compile) <+= (JsKeys.js in Compile)

(compile in Compile) <<= compile in Compile dependsOn (JsKeys.js in Compile)

当我运行compile 时,会在target/scala_2.9.1 文件夹中生成缩小文件。但是当我使用package(来自xsbt-web-plugin)或assembly(来自sbt-assembly)时,我无法在战争中获得这些文件。有什么想法吗?

【问题讨论】:

    标签: javascript scala sbt xsbt-web-plugin


    【解决方案1】:

    查看xsbt-web-plugin,默认情况下似乎从 sourceDirectory/webapp 复制并在 target/webapp 中组装所有内容。

    我认为您需要按here 所示按摩您的 WAR(复制而不是删除除外)或重新配置以将您的缩小 JS 包含在 webappResources 设置中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-07
      • 2011-07-06
      • 1970-01-01
      • 2019-01-27
      • 1970-01-01
      相关资源
      最近更新 更多