有没有一种方法可以在清单文件中将异常添加到require_tree? [英] Is there a way to add an exception to the require_tree in a manifest file?

查看:62
本文介绍了有没有一种方法可以在清单文件中将异常添加到require_tree?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法可以将目录中的所有文件(一个目录除外)或所有目录(一个目录除外)包含在内?像这样:

Is there a way you can include all files in a directory except one, or all directories except one? So something like:

require_tree . :except 'this_one'

只是想知道并且无法弄清清单文件中"require_tree"方法上的文档的位置.

Just wondering and can't figure out where the documentation is on the "require_tree" method in the manifest file.

推荐答案

根据您所用环境的版本,可能会发生以下情况:

Depending on the version of your environment the following may be possible:

//= require_tree "." exclude: "file1", "file2"

请参阅此SO线程:

See this SO thread: Rails 3.1 Sprockets require directives - is there a way to exclude particular files?. Never tried it myself, though.

这篇关于有没有一种方法可以在清单文件中将异常添加到require_tree?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆