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

webpack-synchronizable-shell-plugin

v0.0.7

Published

Run shell commands before and after webpack builds

Downloads

7,737

Readme

Webpack Synchronizable Shell Plugin

This plugin is a fork of webpack-shell-plugin.

It differs from webpack-shell-plugin by allowing user to customize script execution order. For example, we can specify that webpack should block until user's precompile scripts finish executing. Another example is we can execute scripts in the order in which they are specified, or we can execute them in parallel.

The point of this plugin is to give users freedom in choosing how scripts are executed.

Installation

npm install --save-dev webpack-synchronizable-shell-plugin

Setup

In webpack.config.js:

const WebpackSynchronizableShellPlugin = require('webpack-synchronizable-shell-plugin');

module.exports = {
  ...
  ...
  plugins: [
    new WebpackSynchronizableShellPlugin({
      onBuildStart:{
        scripts: ['echo "Webpack Start"'],
        blocking: true,
        parallel: false
      }, 
      onBuildEnd:{
        scripts: ['echo "Webpack End"'],
        blocking: false,
        parallel: true
      }
  })],
  ...
}

API

  • onBuildStart: configuration object for scripts that execute before a compilation. Default:
  {
    scripts: [],
    blocking: false,
    parallel: false
  }
  • onBuildEnd: configuration object for scripts that execute after files are emitted at the end of the compilation. Default:
  {
    scripts: [],
    blocking: false,
    parallel: false
  }
  • onBuildExit: configuration object for scripts that execute after webpack's process is complete. Note: this event also fires in webpack --watch when webpack has finished updating the bundle. Default:
  {
    scripts: [],
    blocking: false,
    parallel: false
  }
  • blocking (onBuildStart, onBuildEnd, onBuildExit): block webpack until scripts finish execution.
  • parallel (onBuildStart, onBuildEnd, onBuildExit): execute scripts in parallel, otherwise execute scripts in the order in which they are specified in the scripts array.

Note: below combination is not supported.

 {
   blocking: true
   parallel: true
 } 
  • dev: switch for development environments. This causes scripts to execute once. Useful for running HMR on webpack-dev-server or webpack watch mode. Default: true
  • safe: switches script execution process from spawn to exec. If running into problems with spawn, turn this setting on. Default: false
  • verbose: DEPRECATED enable for verbose output. Default: false