apostrophecms / apostrophe-monitor

Monitors and restarts an Apostrophe app when your code, templates, etc. change. Like nodemon but much faster because it takes advantage of how Apostrophe works.
8 stars 1 forks source link

Ignore modules' public files and views #4

Closed fredrikekelund closed 5 years ago

fredrikekelund commented 5 years ago

Also ignore files in apostrophe-template's viewsFolderFallback.

Files in the public directories shouldn't have to trigger a restart of the entire apostrophe instance, since LESS/CSS files are recompiled as necessary on each request and front-end JS is simply downloaded again with every request. Something similar was already being done in the nodemonConfig for apostrophe-boilerplate: https://github.com/apostrophecms/apostrophe-boilerplate/pull/13

If I'm not mistaken, apostrophe also watches the views directory of each module and invalidates those files as needed (without the whole Apostrophe instance needing to restart).

boutell commented 5 years ago

Nunjucks is supposed to watch template changes but seems to not be 100% about it, so I would hesitate to stop watching those at least for now.

I think you're right about the public/ folder.

fredrikekelund commented 5 years ago

I haven't had much trouble with views (in fact it's been more reliable than less-middleware reacting to my updated CSS files hehe...) But still, I pushed a commit that rolled back the ignore rule for the views directories, happy to go that way if you think it's more sound!

boutell commented 5 years ago

Thanks!

boutell commented 5 years ago

This has gone out as 2.0.5.

On Tue, May 21, 2019 at 11:38 AM Fredrik Ekelund notifications@github.com wrote:

I haven't had much trouble with views (in fact it's been more reliable than less-middleware reacting to my updated CSS files hehe...) But still, I pushed a commit that rolled back the ignore rule for the views directories, happy to go that way if you think it's more sound!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/apostrophecms/apostrophe-monitor/pull/4?email_source=notifications&email_token=AAAH27O4ULX3ET36TPYQQY3PWQJRDA5CNFSM4HOLDXYKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODV4KBWI#issuecomment-494444761, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAH27LH4R7CIJVCHTORPRLPWQJRDANCNFSM4HOLDXYA .

--

Thomas Boutell, Chief Software Architect P'unk Avenue | (215) 755-1330 | punkave.com