parceleventy icon indicating copy to clipboard operation
parceleventy copied to clipboard

Browsersync loop

Open nothingrandom opened this issue 4 years ago • 4 comments

I often find when saving the document browsersync seems to get itself stuck in a little bit of a rebuild loop.

The attached screenshot is an example of one such situation. This is just one document change & save. I did nothing else in the project in that time other than watch the terminal output.

Screenshot 2019-10-07 10 59 36

nothingrandom avatar Oct 07 '19 09:10 nothingrandom

Yeah, this project is, unfortunately, a bit of a "hack", as parcel and 11ty don't play well together.

During development a parcel plugin watches .tmp/11ty and generates an html file in the .tmp/parcel directory that notifies parcel when files are added and removed, because parcel's dev server does not track new files added after the build begins that are not referenced by the original files.

This can causes the parcel build to be re-run multiple times.

chrisdmacrae avatar Nov 07 '19 01:11 chrisdmacrae

Great, thanks for the info. After using this for a small personal project, I suggested we use this for a production site. For the most part it's working great, but I am finding that the rebuilding is a little annoying in a development environment. Plan to look into it a little more and will report back if we're able to find a solution.

nothingrandom avatar Nov 08 '19 10:11 nothingrandom

@nothingrandom I'm not too familiar with the architecture of this project, but I'd suggest having Parcel watch the Eleventy output directory using it's built-in parcel watch command rather than a plugin to sync the two.

Since a note was added to this project stating it is not actively maintained any more, I feel less bad about recommending taking a look at a project I've been working on: eleventy-parcel-boilerplate. It does essentially the same thing as this project, but I feel the watching functionality might be more reliable.

vseventer avatar Nov 19 '19 16:11 vseventer

this project is, unfortunately, a bit of a "hack", as parcel and 11ty don't play well together.

An alternative: https://github.com/vseventer/eleventy-parcel-boilerplate

DirtyF avatar Nov 19 '19 17:11 DirtyF