mintbit / jekyll-node-module

Include node module assets in your Jekyll build
MIT License
9 stars 1 forks source link

wrong path to node_modules if source is specified #1

Closed agowa closed 1 year ago

agowa commented 1 year ago

If Jekyll is using a different source folder (like when source: src is set within the Jekyll config file), the jekyll-node-module is looking for the node_modules folder within that path instead of the project root.

A workaround is to use ln -s ../node_modules src/node_modules to create a symlink from within the src folder toward the actual node_modules folder. AND to add an exclude for it to the Jekyll config (exclude: ['node_modules']) so that it is not copied toward the final output directory.

schristm commented 1 year ago

Hi @agowa338, I pushed a change that introduces a new config option called modules_dir. By default, jekyll-node-module will continue to look under the source directory for node_modules, but if you add modules_dir: node_modules under node_modules: in your _config.yml, it'll look for a directory named node_modules under your project root.

You can try it out by changing your Gemfile to use gem "jekyll-node-module", github: "mintbit/jekyll-node-module".

Let me know if this fixes your issue, and I'll release it. Thanks.

agowa commented 1 year ago

Now it works, thanks for coming back and fixing it :)

schristm commented 1 year ago

No problem!

schristm commented 1 year ago

Released a new gem version, so you can use that now if you like.

agowa commented 1 year ago

:+1: Thanks