I found a solution to my problem, though from the opposite direction. I had enough free time this weekend to delve into Catalyst's innards and trace the path of the code. The BUILD sub of Catalyst::Restarter is where the list of directories to monitor is set. There's a parameter called "exclude," and it's set to exclude "t" and "root" from monitoring as well as any hidden directories. There appears to be no way to add to or override that list though.

Catalyst::Script::Server is where the restarter is called, and you can pass a few parameters to it from there, including this one:

--rdir --restart_directory the directory to search for modified files, can be set multiple times (defaults to '[SCRIPT_DIR]/..')

So it appears that you can set what directories to monitor but not set what to exclude. I can call the server with --rdir as the "lib" directory instead of the project root, which seems really the only one that needs monitoring anyway, and not have to worry about node_modules or any directories such as those with my Sass files being added to the weight of the server. If I find that anything else needs to be monitored, I can add to it, as --rdir takes an array reference of directories. So calling the server like so works for this problem:

script/myapp_server.pl --rdir /full/path/to/lib -r

It still would be nice to have an option to exclude directories, though, for those occasions when you only need to do so to one rather than having to build up a list of multiple approved directories, but at least there's a way to handle the issue.


In reply to Re^3: Ignoring directories in Catalyst by LunarCowgirl
in thread Ignoring directories in Catalyst by LunarCowgirl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.