From 304a902ea44f628a06addcb1cd3a378911b91a2e Mon Sep 17 00:00:00 2001 From: Ryan Dy Date: Sat, 25 Nov 2017 10:38:52 -0800 Subject: [PATCH] refactor: do not throw errors in case of child context --- src/loader.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/loader.js b/src/loader.js index c7214819..ec893cca 100644 --- a/src/loader.js +++ b/src/loader.js @@ -16,12 +16,11 @@ export function pitch(request) { let loaders = this.loaders.slice(this.loaderIndex + 1); this.addDependency(this.resourcePath); // We already in child compiler, return empty bundle - if (this[NS] === undefined) { // eslint-disable-line no-undefined - throw new Error( + if (this[NS] === undefined || this[NS] === false) { // eslint-disable-line no-undefined + this.emitWarning( '"extract-text-webpack-plugin" loader is used without the corresponding plugin, ' + 'refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example', ); - } else if (this[NS] === false) { return ''; } else if (this[NS](null, query)) { if (query.omit) {