0.2.15 • Published 3 months ago

before-build-webpack v0.2.15

Weekly downloads
8,211
License
MIT
Repository
github
Last release
3 months ago

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)

0.2.15

3 months ago

0.2.14

3 months ago

0.2.13

1 year ago

0.2.12

2 years ago

0.2.11

3 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

6 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

7 years ago