Is there a way to add an exception to the require_tree in a manifest file?

后端 未结 2 1869
温柔的废话
温柔的废话 2021-01-01 14:27

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\'


        
相关标签:
2条回答
  • 2021-01-01 14:47

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

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

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

    0 讨论(0)
  • 2021-01-01 14:52

    Instead of

    require_tree . :except 'this_one'

    write

    require_tree "."

    stub "this_one"

    0 讨论(0)
提交回复
热议问题