gpt4 book ai didi

playframework-2.3 - play 2.3 sbt-concat 在 prod 中不起作用

转载 作者:行者123 更新时间:2023-12-04 20:04:44 28 4
gpt4 key购买 nike

我想用这个插件

addSbtPlugin("net.ground5hark.sbt" % "sbt-concat" % "0.1.8")



连接我的 Assets 。

我有 3 组:
Concat.groups := Seq(
"concat_main.css" -> group(Seq(
"stylesheets/bootstrap.min.css",
"stylesheets/font-awesome.css",
"stylesheets/totem/sidebar/component.css",
"stylesheets/main.min.css"
)),
"concat_main.js" -> group(Seq(
"javascripts/jquery-2.1.0.min.js",
"javascripts/bootstrap.min.js",
"javascripts/totemPage/sidebar/modernizr.custom.js",
"javascripts/totemPage/respond.min.js",
"javascripts/totemPage/html5shiv.js",
"javascripts/totemPage/sidebar/classie.js",
"javascripts/main.js"
)),
"concat_noel.js" -> group(Seq(
"javascripts/totemPage/ouibounce-modal.js",
"javascripts/ouibounce_modal.js",
"javascripts/homePage.js",
"javascripts/totemPage/jquery.cookie.js",
"javascripts/embed.js"
))
)

Concat.parentDir := "public/main/javascripts"

pipelineStages in Assets := Seq(concat, uglify, digest, gzip)

文件是在dev生成的,我可以访问
<link rel="stylesheet" href="@routes.Assets.versioned("javascripts/concat_main.css")">
<script src="@routes.Assets.versioned("javascripts/concat_main.js")" type="text/javascript"></script>

但与 activator start我有一个 404。

最佳答案

sbt-web documentation你可以读到:

If you have some need for the assets produced by the pipelineStages in your development environment (during play run), then you can scope the pipelineStages to the Assets config.

pipelineStages in Assets := Seq(myPipelineTask)



这就是您所做的设置 pipelineStages键范围为 Assets 配置 .但是,这仅适用于开发模式。为了在生产模式下运行管道,您必须设置 pipelineStages键范围为 全局配置 .在您的情况下,这将如下所示:
pipelineStages := Seq(concat, uglify, digest, gzip)

关于playframework-2.3 - play 2.3 sbt-concat 在 prod 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27172901/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com