Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

Commit 8f28427

Browse files
committed
Check if loader is used without plugin
1 parent cea03e2 commit 8f28427

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

loader.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,12 @@ module.exports.pitch = function(request, preReq, data) {
1717
var query = loaderUtils.parseQuery(this.query);
1818
this.addDependency(this.resourcePath);
1919
// We already in child compiler, return empty bundle
20-
if(this[__dirname] === false) {
20+
if(this[__dirname] === undefined) {
21+
throw new Error(
22+
'"extract-text-webpack-plugin" loader is used without the corresponding plugin, ' +
23+
'refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example'
24+
);
25+
} else if(this[__dirname] === false) {
2126
return "";
2227
} else if(this[__dirname](null, query)) {
2328
if(query.omit) {

0 commit comments

Comments
 (0)