【问题标题】:Phoenix: how to include bower-installed .js?Phoenix:如何包含凉亭安装的 .js?
【发布时间】:2016-08-10 12:53:15
【问题描述】:

我已通过早午餐将凉亭包安装到 Phoenix 应用程序中。如何将该包中的 .js 文件包含到我的应用程序中?包安装到/bower_components——我需要在某个地方添加它来构建它吗?或者有没有帮我手动在每个布局中包含js?

【问题讨论】:

    标签: bower phoenix-framework brunch


    【解决方案1】:

    Here's 给任何寻找这个的人的答案:

    如果你已经安装了你的包,只需公开文件夹:

    plug Plug.Static,
      at: "/", from: :discovery, gzip: false,
      only: ~w(css fonts images js favicon.ico robots.txt bower_components)
    

    这是在将您的包添加到 bower.json 并将文件夹添加到 .bowerrc 之后。

    【讨论】:

    • 注意:bower_components 文件夹必须在web/static/assets 中才能正常工作;您可以使用.bowerrc 进行设置。
    猜你喜欢
    • 1970-01-01
    • 2014-08-08
    • 2013-07-03
    • 2014-02-09
    • 2013-05-23
    • 1970-01-01
    • 1970-01-01
    • 2017-03-14
    • 1970-01-01
    相关资源
    最近更新 更多