diff --git a/index.js b/index.js index e6ee9e7a..75ef6216 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,7 @@ var Chunk = require("webpack/lib/Chunk"); var OrderUndefinedError = require("./OrderUndefinedError"); var loaderUtils = require("loader-utils"); var validateOptions = require('schema-utils'); +var path = require('path'); var NS = fs.realpathSync(__dirname); @@ -124,7 +125,7 @@ function ExtractTextPlugin(options) { if(isString(options)) { options = { filename: options }; } else { - validateOptions('./schema/plugin.json', options, 'Extract Text Plugin'); + validateOptions(path.resolve(__dirname, './schema/plugin.json'), options, 'Extract Text Plugin'); } this.filename = options.filename; this.id = options.id != null ? options.id : ++nextId; @@ -203,7 +204,7 @@ ExtractTextPlugin.prototype.extract = function(options) { if(Array.isArray(options) || isString(options) || typeof options.options === "object" || typeof options.query === 'object') { options = { loader: options }; } else { - validateOptions('./schema/loader.json', options, 'Extract Text Plugin (Loader)'); + validateOptions(path.resolve(__dirname, './schema/loader.json'), options, 'Extract Text Plugin (Loader)'); } var loader = options.use ||  options.loader; var before = options.fallback || options.fallbackLoader || [];