Git Product home page Git Product logo

Comments (5)

jescalan avatar jescalan commented on July 19, 2024

Hey @axelboc!

Thanks for writing such a clear and straightforward issue. I hope I'll be able to help with this one.

ignores, as the docs mention, are only ignored from the compile process, not the watcher. You can use watcher_ignores to update which files the watcher doesn't keep track of. These do have to be separate for a good reason, and much thought was put into this particular design pattern. Out of the box, partials are ignored from the compiler but not the watcher.

dump_dirs doesn't mean just copy the asset without processing, it basically means un-nest these assets from the folder listed in the array when putting them in the output. Sorry, I can totally see how the description is confusing, maybe you would be able to help suggest a more clear way? So basically, if you have assets in the dump_dirs array, then you have assets/favicon.ico and assets.css/index.css in the assets folder, in the output, they will be un-nested from the assets folder and just left at root, as public/favicon.ico and public/css/index.css. It doesn't have anything to do with compilation, it just deals with un-nesting nested folders from assets when going to the output.

As far as static files being copied, basically roots takes any non-ignored and non-compiled files and copies them over to the output. So if there's any file in your source that you do not want to be in the output, you must explicitly add it to the ignores.

Hope this helps, and let me know if I didn't do a good job explaining any of this and I can take another crack at it!

from roots.

axelboc avatar axelboc commented on July 19, 2024

Wow, thanks!

dump_dirs makes a lot more sense to me now; the concrete example you gave did the trick: assets/css/index.css gets compiled to public/css/index.css instead of public/assets/css/index.css. Also, glad to hear that the watcher's ignores are now separate - it's a shame that the documentation is not up to date, though!

Here are a couple of follow-up questions:

  • I had a look at roots/config.coffee and was wondering why node_modules is not ignored by default (it's in watcher_ignores but not in ignores). How does Roots know not to process the folder?
  • You mentioned that partials are ignored by default. Is this still true? If I remove the globs views/**/_* and assets/css/_* from my own config, Roots compiles them. I think it's good if they're not ignored, by the way, as I have a file that starts with an underscore in the assets folder which I want copied to the output folder, so if **/_* were ignored, that file wouldn't get copied.

Regarding the fact that files have to be ignored in order for them not to be compiled/copied into the output folder; I can't help but wonder whether the other way around would make more sense (i.e. telling Roots which files to process), especially now that the watcher is completely independent.

Anyway, thanks to your clarifications, I was able to fix a few bugs in my configuration. Unfortunately, I'm still facing an infinite compile loop when I run roots watch. 😢 Is there a way to see which files the watcher thinks have changed. I tried the debug and verbose options, but nothing more gets logged to the console; just compiling... done over and over again. (Any reason why these options don't work by the way? It'd be so awesome if they printed which files Roots compiles and with which compilers! It'd be really helpful for debugging the config and understanding Roots' internals.)

from roots.

jescalan avatar jescalan commented on July 19, 2024

Would love any help with the docs, they are open source as is every part of roots!

First question, roots never reads any node_modules or .git folders, you can see where it skips em here.

Second question, no, the default is in the base template. We purposely give users control over whether they want to use the partial pattern or not by not putting this in core.

For the third question about flipping things, from our experience the answer is no. This way of doing things is very frustrating, and results in really huge config files. Gulp/grunt etc work like this and you have seen how huge their configs get. If there's a file in your source, chances are you want it to be compiled somehow.

As for the debugging, it's tough on windows. Nobody that works on this has windows, so it is just not a priority for us at the moment. As for the verbose option, it should work, if not that is a bug that should be fixed! You can always pull roots down, npm link, and log the filename out from the compiler.

from roots.

axelboc avatar axelboc commented on July 19, 2024

It makes sense, thanks for clarifying all this! I'll take a look at the verbose option as you suggest, and try to debug the watcher issue. I've got my config under control now and I understand it, which is awesome! Thanks for your help.

from roots.

jescalan avatar jescalan commented on July 19, 2024

No problem, glad I could help! Happy to answer any other questions if you've got em 😀

from roots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.