Laravel Mix plugin for Jigsaw.
latest v2.1.1 - released
567 downloads last week
MIT license
18 versions

Jigsaw plugin for Laravel Mix

MIT License Latest Stable Version Total Downloads

laravel-mix-jigsaw is a Laravel Mix plugin for the Jigsaw static site generator. It watches your Jigsaw site's files and triggers a new Mix build when it detects changes.

const mix = require('laravel-mix');

    .js('source/_assets/js/main.js', 'js')
    .css('source/_assets/css/main.css', 'css')


npm install -D laravel-mix-jigsaw


Require the module in your webpack.mix.js file.

const mix = require('laravel-mix');

Enable the build tasks by calling .jigsaw() anywhere in your Mix build chain.

mix.js('source/_assets/js/main.js', 'js')
    .css('source/_assets/css/main.css', 'css')

By default this plugin watches common Jigsaw file paths and triggers a new build when it detects changes. To add watched paths or override the watcher configuration, pass a config object to .jigsaw():

// Add additional file paths to watch
    watch: ['config.*.php'],

// Override the default config
    watch: {
        files: ['source/posts/*.blade.php'],
        notDirs: ['source/_assets/', 'source/assets/', 'source/ignore/'],

If you use Laravel Mix's built-in BrowserSync integration, you may need to configure it to watch Jigsaw's paths:

        server: 'build_local',
        files: ['build_*/**'],


  • The plugin cannot detect the creation of new files immediately inside the source/ directory of your site. If you create a new file like source/home.blade.php, you'll need to stop and restart Mix.
  • With v1 of the plugin it was possible to add additional Webpack plugins/tasks that would run after the Jigsaw build but before Mix finished compiling assets. This created compatibility issues between this plugin and Mix itself, and was removed in v2. If you need to perform additional processing after your Jigsaw site is built, like minifying its HTML, you can do so using a Jigsaw event listener.


Huge thanks to Brandon Nifong for creating the initial version of this plugin!


Laravel Mix Jigsaw is provided under the MIT License.