# Jekyll, Bundler and NPM

**URL:** <https://talk.jekyllrb.com/t/jekyll-bundler-and-npm/5203>\
**Category:** Help\
**Created:** [November 9, 2020, 5:29pm UTC](https://talk.jekyllrb.com/t/jekyll-bundler-and-npm/5203 "2020-11-09T17:29:04Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [November 10, 2020, 1:09pm UTC](https://talk.jekyllrb.com/t/jekyll-bundler-and-npm/5203/2 "2020-11-10T13:09:57Z")

</div>

Hi Koos

I know your struggle and have a solution fr you. GitHub Pages does not support custom builds with NPM etc. But you can use GitHub Actions with a config of like 100 lines or Netlify with a config of a few lines.

Some Ruby or Jekyll projects use `rake` to manage npm install and other tasks but I struggle to get into it.

My approach is to use a `Makefile` and call it with `make` command. That comes from the C compilation background but you’ll also see it in Python and C++ projects. It comes with mac and linux and I think you can install on windows

Here is my simple Jekyll related makefile.

> <https://github.com/MichaelCurrin/jekyll-blog-demo/blob/master/Makefile>

To use it:

```auto
cd repo
make install
make build

```

And now the site is built.

Run those commands on GitHub Actions or your remote server and it will work the same. On Netlify you don’t even need to run make install as Netlify finds a Gemfile and package.json and installs for you.

I use a Makefile for all my Jekyll projects as it let’s me manage by commands easily and I can run multiple tasks underneath like NPM and Bundle steps to install or build.

For example to you can define commands as

```auto
install-js:
	npm install

install-gems:
	bundle config set --local path vendor/bundle
	bundle install

install: install-js install-gems

```

Which means when you run

```auto
make install

```

It runs

```auto
npm install
bundle config...
bundle install

```

And you can define build as

```auto
build:
  npm run build
  bundle exec jekyll build --trace

```

So you just have to run `make build` and it will run both commands.

And then you would have `make build` as the build step in your Netlify config or GH Actions workflow.

Note that make will exit on failure so it effectively does

```auto
npm run build && bundle exec ...

```

---

_[View the full topic](https://talk.jekyllrb.com/t/jekyll-bundler-and-npm/5203)._
