Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

trick eleventy into watching generated files #3749

Merged
merged 3 commits into from Aug 24, 2020
Merged

Conversation

samthor
Copy link
Contributor

@samthor samthor commented Aug 20, 2020

We had a bug, if we compiled CSS or JS during dev, Eleventy wouldn't rebuild. It was ignoring changes in the top-level .gitignore, but some of these files change during dev, and point to the latest JS/CSS.

Work around this by tricking Eleventy. The alternative is we create a whole .eleventyignore file which mostly mirrors .gitignore.

@samthor samthor requested a review from a team as a code owner August 20, 2020 04:55
@googlebot googlebot added the cla: yes Contributor has signed the CLA label Aug 20, 2020
@netlify
Copy link

netlify bot commented Aug 20, 2020

Deploy preview for web-dev-staging ready!

Built with commit c42018d

https://deploy-preview-3749--web-dev-staging.netlify.app

@robdodson
Copy link
Contributor

I'd prefer to use .eleventyignore since that's really what it's there for.

@robdodson
Copy link
Contributor

There's a lot we could remove from our .gitignore as well. i think it may have been a template I copied from devsite or something.

Copy link
Contributor

@robdodson robdodson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to suggest that we use .eleventyignore (we already have one anyway but I don't think it's actually being used because we don't call eleventyConfig.setUseGitIgnore(false);)

FWIW on d.c.c. I'm using eleventyignore to ignore generated files in the src directory, so this sorta gels with that approach.

@samthor
Copy link
Contributor Author

samthor commented Aug 21, 2020

I'm happy to use Eleventy's ignore file. I'll swap over.

@samthor
Copy link
Contributor Author

samthor commented Aug 21, 2020

Fixed, changed to ".eleventyignore".

@@ -0,0 +1,2 @@
# Temporary files generated by builds that point to our CSS/JS entrypoints.
resource*.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if this could be moved back to the .gitignore at the root of the project? Are you trying to hide it from git or eleventy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved it back.

The thought was it provides more context being adjacent to the file, irrespective of Eleventy's odd behavior (since we solve that with its own ignore file now). But I honestly don't have a strong opinion.

We also only have one .gitignore file now.

@samthor samthor merged commit f199270 into master Aug 24, 2020
@samthor samthor deleted the eleventy-trick-gitignore branch August 24, 2020 01:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Contributor has signed the CLA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants