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

fix: fails to find ./schema/loader.json #535

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ var Chunk = require("webpack/lib/Chunk");
var OrderUndefinedError = require("./OrderUndefinedError");
var loaderUtils = require("loader-utils");
var validateOptions = require('schema-utils');
const path = require('path');

var NS = fs.realpathSync(__dirname);

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 || [];
Expand Down Expand Up @@ -336,7 +337,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) {
});

var file = (isFunction(filename)) ? filename(getPath) : getPath(filename);

compilation.assets[file] = source;
chunk.files.push(file);
}
Expand Down