Skip to content


On this page:


Use a shell script that runs before your build to extend the functionality of your sites. Run tools like Gulp and Webpack before your build.

To run a prebuild script:

  1. Create a file at the root of your file structure
  2. Enter the commands you want to run before each site build.

The prebuild script runs in a Node.js environment, if you need to install any npm packages.

Here’s an example file that bundles JavaScript files using webpack:

npm install webpack
npm install webpack-cli

./node_modules/.bin/webpack path/to/entry.js -o js/output.js

Prebuild commands allow you to incorporate your favourite tools for building and pre-processing into CloudCannon. Some ideas for using this feature include:

  • Bundling JavaScript
  • Fetching API data
  • Running build commands other than Jekyll
  • Sending messages to your Slack channel
On this page:


Don’t miss the latest
CloudCannon news freshly delivered to your inbox