Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add addWatchTarget() option to config #641

Merged
merged 9 commits into from
Nov 27, 2019

Conversation

MadeByMike
Copy link
Contributor

@MadeByMike MadeByMike commented Aug 1, 2019

I'm trying to move away from build processes tacked onto the front of SSGs. This little helper makes this much easier. It allows you to add a custom watch target so that I can tell eleventy, when my scss or javascript files change, I want you to rebuild the site.

Here's how I use it:

// Additional watch targets
config.addWatchTarget('./src/scss/'); 
config.addWatchTarget('./src/js/');

@MadeByMike
Copy link
Contributor Author

The build passed but Travis wigged out... can we re-trigger it?

@zachleat
Copy link
Member

Restarted!

@MadeByMike
Copy link
Contributor Author

MadeByMike commented Aug 18, 2019

Don't get it... same thing happened. Windows test all pass, but the CI doesn't close and will timeout. I ran this locally on Windows and "Works on my Machine" - ideas?

@MadeByMike
Copy link
Contributor Author

Yay \o/ looks like this was a know issue with Windows builds on Travis. Adding an env var YARN_GPG=no fixed it.

More discussion on this here: https://travis-ci.community/t/build-doesnt-finish-after-completing-tests/288

@MadeByMike
Copy link
Contributor Author

@zachleat would it be too much to ping you again now that the build is passing?

@zachleat
Copy link
Member

Before I merge this just one question: are the watch targets here relative to the input directory or the project root?

@MadeByMike
Copy link
Contributor Author

@zachleat it eventually uses the addRaw() method of EleventyWatchTargets.js which I think means it's relative to the current working directory? Which is usually the same as the project root. Do you think we want to explicitly make this relative to something?

@ardouglass
Copy link

It looks like this solves #333 and #651. Can't wait for a new release. =)

@MadeByMike
Copy link
Contributor Author

Yay @zachleat "Only those with write access to this repository can merge pull requests."

@zachleat
Copy link
Member

zachleat commented Nov 4, 2019

Sorry Mike I’ve been swamped here I’ll try to get to this in the next few days!

@MadeByMike
Copy link
Contributor Author

@zachleat <3 I know buddy. Take as long as you need.

@zachleat zachleat merged commit c7139b7 into 11ty:master Nov 27, 2019
@zachleat
Copy link
Member

START THE PARADE

@zachleat
Copy link
Member

Thank you @MadeByMike, this is a lovely addition 👍

@kevinmpowell
Copy link

I'm having trouble getting this to work with watching a single file:

  eleventyConfig.addWatchTarget("./components");

Works, but I don't want to watch that entire directory

  eleventyConfig.addWatchTarget("./components/concatenated.njk");

☝️ does not work. Can anyone else duplicate?

@zachleat
Copy link
Member

Hey @kevinmpowell please file a new issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants