【问题标题】:Grails 3 - Angular template asset pipeline not bundling converted js files into application.jsGrails 3 - Angular 模板资产管道未将转换后的 js 文件捆绑到 application.js
【发布时间】:2017-06-08 07:58:34
【问题描述】:

我正在使用 Grails 3.1.10、angular-template-asset-pipeline 2.2.6 和 assets-pipeline-gradle 2.8.2

我在防火墙后面工作时很难共享配置文件,但一般问题与https://github.com/bertramdev/grails-asset-pipeline/issues/336 大体相似(讨论已开始,所以我必须随时更新问题)

在“grails run-app”下一切正常,但是当我运行“grails war”时:

  1. 模板正确转换为 js 文件
  2. 在 /webapps/myApp/assets 下的 tomcat 中爆炸
  3. 在 application.js 捆绑结果中存在,因此我的应用找不到任何 html。

任何帮助表示赞赏。

我被要求在我的 application.groovy 开发环境中放入资产,以便运行应用程序工作,但我不确定在运行“grails war”时是否使用了 application.groovy .. 我不是粉丝具有重复的资产管道配置。 (每个环境的 build.gradle 和 application.groovy)

谢谢!

【问题讨论】:

    标签: gradle asset-pipeline assets angular-template grails3


    【解决方案1】:

    在我弄清楚配置来自哪个配置文件(run-app -> application.groovy,grails war -> build.gradle)之后......我想通了。

    我让它通过以下步骤工作......

    1. 我将所有 templateUrl: 'file.html' 调用移至 templateUrl: '/myApp/file.html'(指令和查看代码)
    2. 我设置了“includePathInName=true”
    3. 我将 .tpl.html 文件放在 grails-app/assets/javascripts/myApp/templates 中

    重要的一点是 grails-app/assets/javascripts/templates 对我不起作用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-27
      • 2016-06-25
      • 2014-10-04
      相关资源
      最近更新 更多