jekyll-vue-template icon indicating copy to clipboard operation
jekyll-vue-template copied to clipboard

Could you add live reloading?

Open liquidvisual opened this issue 7 years ago • 4 comments

Thanks for making this, great library! Is it possible to add some sort of live reloading - like BrowserSync?

liquidvisual avatar Jul 05 '18 00:07 liquidvisual

Thanks, that's a great suggestion. I'm working on live reloading using Browsersync now. I have a working solution for live reloads triggered either by Jekyll or webpack-managed content.

Unfortunately, this still requires manually running two separate shells, one for webpack and one for Jekyll, due to a race condition. Specifically, resources built with webpack --watch are unavailable at the time bundle exec jekyll build --watch is called, causing an error.

I'll continue looking into a more elegant solution, but for the time being this feature is available in the dev branch.

Splode avatar Jul 08 '18 05:07 Splode

Nice, thanks for that - I'll check it out!

I've also been playing with vue-jekyll, have you ever used it? If so, what is your opinion of it?

It seems to work quite well (single shell), although its dependencies are very much out of date. I was able to get the Sass working with BrowserSync after adding in the loaders.

liquidvisual avatar Jul 11 '18 02:07 liquidvisual

Yep 👍🏻 In fact, Bryan Schuetz (creator of vue-jekyll) wrote an article, Vue and Jekyll, which was the inspiration for this project. I wanted something similar, but with updated libraries and some features like code-splitting, hashing, etc.

Splode avatar Jul 11 '18 14:07 Splode

I use the npm-run-all npm package, jekyll serve --livereload and webpack —watch to automatically refresh changes.

  "scripts": {
    "dev": "cross-env NODE_ENV=development webpack",
    "build": "cross-env NODE_ENV=production webpack --progress --hide-modules",
+   "serve": "bundle exec jekyll serve --livereload",
+   "start": "run-p watch serve",
    "watch": "cross-env NODE_ENV=development webpack --watch"
  },

# _config.yml

  # Build settings
  markdown: kramdown

+ # Server settings
+ host: 0.0.0.0
+ port: 9001
+ encoding: UTF-8

sonnienguyen avatar Sep 05 '18 02:09 sonnienguyen