From 1001b2518661a51f6d2d6add853b74472ade3dc5 Mon Sep 17 00:00:00 2001 From: Sresan Thevarajah Date: Mon, 13 Feb 2017 11:03:35 -0800 Subject: [PATCH 1/3] Add a not null check for the content property before throwing error --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index cb1d3259..108d1009 100644 --- a/index.js +++ b/index.js @@ -269,7 +269,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) { return callback(); } meta = module[NS]; - if(!Array.isArray(meta.content)) { + if(!Array.isArray(meta.content) && meta.context != null) { err = new Error(module.identifier() + " doesn't export content"); compilation.errors.push(err); return callback(); From 7940c447e6246d428c46070cacfcb0302817e576 Mon Sep 17 00:00:00 2001 From: Sresan Thevarajah Date: Mon, 13 Feb 2017 11:07:19 -0800 Subject: [PATCH 2/3] content not context... --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 108d1009..21a11c94 100644 --- a/index.js +++ b/index.js @@ -269,7 +269,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) { return callback(); } meta = module[NS]; - if(!Array.isArray(meta.content) && meta.context != null) { + if(!Array.isArray(meta.content) && meta.content != null) { err = new Error(module.identifier() + " doesn't export content"); compilation.errors.push(err); return callback(); From 12a6e443e39426162921defd7f0a8fee63f79efe Mon Sep 17 00:00:00 2001 From: Sresan Thevarajah Date: Mon, 24 Apr 2017 09:53:17 -0700 Subject: [PATCH 3/3] Add comment to fix --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 21a11c94..f837d39e 100644 --- a/index.js +++ b/index.js @@ -269,6 +269,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) { return callback(); } meta = module[NS]; + // Error out if content is not an array and is not null if(!Array.isArray(meta.content) && meta.content != null) { err = new Error(module.identifier() + " doesn't export content"); compilation.errors.push(err);