webpack-hooks-shellscripts
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

webpack-hooks-shellscripts

Build Status Maintainability NPM version NPM bundle size

Just triggers some shellscripts on webpack compiler hooks.

Install

yarn add -D webpack-hooks-shellscripts

Usage

Add the plugin to your webpack config.

// webpack.config.js
const hooksScriptPlugin = require('webpack-hooks-shellscripts')
 
module.exports = {
  plugins: [
    hooksScriptPlugin({
      beforeEmit: ['rm -r ./dist'],
      afterEmit: ['echo "Build succeeded"']
    })
  ]
}

API

hooksShellScriptsPlugin(bindings)

bindings

Type: object

Hooks/Scripts bindings.

// example
{
  beforeRun: ['echo "do this"', 'echo "then that"'],
  beforeCompile: ['./do-something']
}

See https://webpack.js.org/api/compiler-hooks/ to get an exhaustive hooks list.

License

MIT © Nutshell

Dependents (2)

Package Sidebar

Install

npm i webpack-hooks-shellscripts

Weekly Downloads

9

Version

1.0.2

License

MIT

Unpacked Size

6.9 kB

Total Files

10

Last publish

Collaborators

  • vblitz