npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

laravel-mix-jigsaw

v2.1.1

Published

Laravel Mix plugin for Jigsaw

Downloads

2,269

Readme

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');
require('laravel-mix-jigsaw');

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

Installation

npm install -D laravel-mix-jigsaw

Usage

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

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

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')
    .jigsaw();

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
mix.jigsaw({
    watch: ['config.*.php'],
});

// Override the default config
mix.jigsaw({
    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:

mix.jigsaw()
    .browserSync({
        server: 'build_local',
        files: ['build_*/**'],
    });

Caveats

  • 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.

Credits

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

License

Laravel Mix Jigsaw is provided under the MIT License.