From 9c78c43f95f4ca79b78fa0fbfe72ed96946c0403 Mon Sep 17 00:00:00 2001 From: MirrorBytes Date: Thu, 8 Jun 2017 02:26:24 -0400 Subject: [PATCH 1/2] Quick fix for [ENOENT: "./schema/loader.json"] --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 || []; From fb8e098f8ea4417c53d67a62d90f01d52c0115e3 Mon Sep 17 00:00:00 2001 From: MirrorBytes Date: Mon, 12 Jun 2017 23:25:41 -0400 Subject: [PATCH 2/2] mapModules fix --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index ed5b11f4..e7677ee1 100644 --- a/index.js +++ b/index.js @@ -269,7 +269,7 @@ ExtractTextPlugin.prototype.apply = function(compiler) { async.forEach(chunks, function(chunk, callback) { var extractedChunk = extractedChunks[chunks.indexOf(chunk)]; var shouldExtract = !!(options.allChunks || isInitialOrHasNoParents(chunk)); - async.forEach(chunk.modules.slice(), function(module, callback) { + async.forEach(chunk.mapModules(function(c) { return c; }), function(module, callback) { var meta = module[NS]; if(meta && (!meta.options.id || meta.options.id === id)) { var wasExtracted = Array.isArray(meta.content);