Search code examples
javascriptjqueryjekyll

Jekyll node_modules not found while using load_paths


I am trying to configure jQuery in a Jekyll project. I am having issues referencing my script tags (if I include a cdn its fine).

I was reading up on some issues where github-pages may not process your node_modules. But, I am just working locally with no luck.

Would js files be loaded differently not under a sass: > load_paths:? Does it matter? (Sass files work fine but no js files are working)

_config.yml

sass:
  load_paths:
    - _sass
    - node_modules/

My footer:

<script src="{{'/node_modules/jquery/dist/jquery.min.js' | prepend: site.baseurl}}"></script>

Error:

[2019-03-27 12:44:36] ERROR `/node_modules/jquery/dist/jquery.min.js' not found.


Solution

  • Adding exclude: [] to my _config.yml file fixed this issue should this help anyone.