From c37c614ee38272a8c12370afbfd7ef0e26f1b83f Mon Sep 17 00:00:00 2001 From: Will Farley Date: Wed, 8 Jun 2016 11:06:29 -0400 Subject: [PATCH] Add support for webpack@2.1.0-beta Fixes the error that webpack 2.1.0-beta.7 will throw if not entry or plugins are specified in options. Update peer dependencies for webpack@2.1.0-beta.X --- index.js | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6d9abbe3..6ec95f5c 100644 --- a/index.js +++ b/index.js @@ -24,6 +24,10 @@ function Plugin( // The webpack tier owns the watch behavior so we want to force it in the config webpackOptions.watch = true; + // Webpack 2.1.0-beta.7+ will throw in error if both entry and plugins are not specified in options + // https://github.com/webpack/webpack/commit/b3bc5427969e15fd3663d9a1c57dbd1eb2c94805 + if(!webpackOptions.entry) webpackOptions.entry = {}; + if(!webpackOptions.output) webpackOptions.output = {}; // When using an array, even of length 1, we want to include the index value for the build. diff --git a/package.json b/package.json index c5b16088..c2212f63 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "author": "Tobias Koppers @sokra", "description": "Use webpack with karma", "peerDependencies": { - "webpack": "^1.4.0" + "webpack": "^1.4.0 || ^2 || ^2.1.0-beta" }, "dependencies": { "async": "~0.9.0",