From 5b082b0bac0e068e9246d67c5cf6edeac3a5675b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=B6nthal?= Date: Thu, 2 Feb 2017 11:54:19 +0100 Subject: [PATCH] dont throw errors in case of child-context will work with this conditional webpack rule: ```js { test: /\.scss$/, oneOf: [ {test: /html-webpack-plugin/, use: "null-loader"}, { use: ExtractTextPlugin.extract({ fallbackLoader: 'style-loader', loader: ['css-loader', 'sass-loader'] }) } ] }, ``` --- loader.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/loader.js b/loader.js index 4960135f..3c067375 100644 --- a/loader.js +++ b/loader.js @@ -23,12 +23,7 @@ module.exports.pitch = function(request) { var loaders = this.loaders.slice(this.loaderIndex + 1); this.addDependency(this.resourcePath); // We already in child compiler, return empty bundle - if(this[NS] === undefined) { - throw new Error( - '"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) { + if(this[NS] === undefined || this[NS] === false) { return ""; } else if(this[NS](null, query)) { if(query.omit) {