Skip to content

Webpack (v1-5) plugin that gives ability to add callback before build (or after, or at any other event hook). Can stop compilation by condition.

License

Notifications You must be signed in to change notification settings

artemdudkin/before-build-webpack

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

before-build-webpack

Webpack (v1-5) plugin that gives ability to add callback before build (or after, or any other event hook). Can stop compilation by condition.

tests status NPM Downloads

Installation

npm install --save-dev before-build-webpack

Usage

In config file:

var WebpackBeforeBuildPlugin = require('before-build-webpack');
// ...
  module: {
    plugins: [
      new WebpackBeforeBuildPlugin(function(stats, callback) {
        // Do whatever you want...
        callback(); // don't call it if you do want to stop compilation
      }),
    ]
  },
// ...

OR (more power)

// ...
  module: {
    plugins: [
      new WebpackBeforeBuildPlugin(function(stats, callback) {
        // ...
      }, ['run', 'watch-run', 'done']), // will fire before build and after build
    ]
  },
// ...

You can use pre-v4 or v4 hook names (i.e. any of watch-run and watchRun)

About

Webpack (v1-5) plugin that gives ability to add callback before build (or after, or at any other event hook). Can stop compilation by condition.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%