Skip to content

Commit

Permalink
add webpack 5 support
Browse files Browse the repository at this point in the history
  • Loading branch information
s00d committed Oct 20, 2020
1 parent 1c580d9 commit 1294a9b
Show file tree
Hide file tree
Showing 6 changed files with 639 additions and 3,116 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.0](https://github.com/s00d/webpack-shell-plugin-next/compare/v1.2.0...v2.0.0) (2020-10-20)

### ⚠ BREAKING CHANGES

* webpack@4 no longer supported

### Bug Fixes

* reduce deps

## [1.1.8] - 2020-08-14

### Changed
Expand Down
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
[![donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.me/s00d)
# Webpack Shell Plugin Next

fix webpack 4 deprecated method. add typescript and other

This plugin allows you to run any shell commands before or after webpack 4 builds. This will work for both webpack 4.

Goes great with running cron jobs, reporting tools, or tests such as selenium, protractor, phantom, ect.

## Webpack compatibility

Webpack | webpack-shell-plugin-next
:-------------|:----------
*-4.x | 1.*
5.x | 2.*

## WARNING

This plugin is meant for running simple command line executions. It is not meant to be a task management tool.
Expand Down
27 changes: 8 additions & 19 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Expand Down Expand Up @@ -388,24 +388,13 @@ var WebpackShellPlugin = /** @class */ (function () {
});
};
WebpackShellPlugin.prototype.apply = function (compiler) {
if (compiler.hooks) {
compiler.hooks.beforeRun.tapAsync('webpack-shell-plugin-next', this.onBeforeRun);
compiler.hooks.invalid.tap('webpack-shell-plugin-next', this.onInvalid);
compiler.hooks.compilation.tap('webpack-shell-plugin-next', this.onCompilation);
compiler.hooks.afterEmit.tapAsync('webpack-shell-plugin-next', this.onAfterEmit);
compiler.hooks.done.tapAsync('webpack-shell-plugin-next', this.onDone);
compiler.hooks.afterCompile.tapAsync('webpack-shell-plugin-next', this.afterCompile);
compiler.hooks.watchRun.tapAsync('webpack-shell-plugin-next', this.watchRun);
}
else {
compiler.plugin('before-run', this.onBeforeRun);
compiler.plugin('invalid', this.onInvalid);
compiler.plugin('compilation', this.onCompilation);
compiler.plugin('after-emit', this.onAfterEmit);
compiler.plugin('done', this.onDone);
compiler.plugin('after-compile', this.afterCompile);
compiler.plugin('watch-run', this.watchRun);
}
compiler.hooks.beforeRun.tapAsync('webpack-shell-plugin-next', this.onBeforeRun);
compiler.hooks.invalid.tap('webpack-shell-plugin-next', this.onInvalid);
compiler.hooks.compilation.tap('webpack-shell-plugin-next', this.onCompilation);
compiler.hooks.afterEmit.tapAsync('webpack-shell-plugin-next', this.onAfterEmit);
compiler.hooks.done.tapAsync('webpack-shell-plugin-next', this.onDone);
compiler.hooks.afterCompile.tapAsync('webpack-shell-plugin-next', this.afterCompile);
compiler.hooks.watchRun.tapAsync('webpack-shell-plugin-next', this.watchRun);
};
WebpackShellPlugin.prototype.log = function (text) {
if (this.logging) {
Expand Down
Loading

0 comments on commit 1294a9b

Please sign in to comment.