Skip to content

Commit 8766821

Browse files
MirrorBytesmichael-ciniawsky
authored andcommitted
fix(index): resolve schemas relative to __dirname (webpack-contrib#536)
1 parent 0271b39 commit 8766821

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ var Chunk = require("webpack/lib/Chunk");
1010
var OrderUndefinedError = require("./OrderUndefinedError");
1111
var loaderUtils = require("loader-utils");
1212
var validateOptions = require('schema-utils');
13+
var path = require('path');
1314

1415
var NS = fs.realpathSync(__dirname);
1516

@@ -124,7 +125,7 @@ function ExtractTextPlugin(options) {
124125
if(isString(options)) {
125126
options = { filename: options };
126127
} else {
127-
validateOptions('./schema/plugin.json', options, 'Extract Text Plugin');
128+
validateOptions(path.resolve(__dirname, './schema/plugin.json'), options, 'Extract Text Plugin');
128129
}
129130
this.filename = options.filename;
130131
this.id = options.id != null ? options.id : ++nextId;
@@ -203,7 +204,7 @@ ExtractTextPlugin.prototype.extract = function(options) {
203204
if(Array.isArray(options) || isString(options) || typeof options.options === "object" || typeof options.query === 'object') {
204205
options = { loader: options };
205206
} else {
206-
validateOptions('./schema/loader.json', options, 'Extract Text Plugin (Loader)');
207+
validateOptions(path.resolve(__dirname, './schema/loader.json'), options, 'Extract Text Plugin (Loader)');
207208
}
208209
var loader = options.use ||  options.loader;
209210
var before = options.fallback || options.fallbackLoader || [];

0 commit comments

Comments
 (0)