Socket
Socket
Sign inDemoInstall

extract-text-webpack-plugin

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

extract-text-webpack-plugin - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

OrderUndefinedError.js

18

ExtractedModule.js

@@ -8,3 +8,3 @@ /*

function ExtractedModule(identifier, originalModule, source, sourceMap, addtitionalInformation) {
function ExtractedModule(identifier, originalModule, source, sourceMap, addtitionalInformation, prevModules) {
this._identifier = identifier;

@@ -14,2 +14,3 @@ this._originalModule = originalModule;

this._sourceMap = sourceMap;
this._prevModules = prevModules;
this.addtitionalInformation = addtitionalInformation;

@@ -44,1 +45,16 @@ this.chunks = [];

};
ExtractedModule.prototype.getOriginalModule = function() {
return this._originalModule;
};
ExtractedModule.prototype.getPrevModules = function() {
return this._prevModules;
}
ExtractedModule.prototype.addPrevModules = function(prevModules) {
prevModules.forEach(function(m) {
if(this._prevModules.indexOf(m) < 0)
this._prevModules.push(m);
}, this);
};

@@ -13,2 +13,3 @@ /*

var Chunk = require("webpack/lib/Chunk");
var OrderUndefinedError = require("./OrderUndefinedError");
var loaderUtils = require("loader-utils");

@@ -201,2 +202,9 @@

extractedChunk.modules.sort(function(a, b) {
var order = getOrder(a, b);
if(isNaN(order)) {
compilation.errors.push(new OrderUndefinedError(a.getOriginalModule()));
compilation.errors.push(new OrderUndefinedError(b.getOriginalModule()));
}
if(order !== 0 && !isNaN(order))
return order;
var ai = a.identifier();

@@ -251,6 +259,8 @@ var bi = b.identifier();

ExtractTextPluginCompilation.prototype.addModule = function(identifier, originalModule, source, additionalInformation, sourceMap) {
ExtractTextPluginCompilation.prototype.addModule = function(identifier, originalModule, source, additionalInformation, sourceMap, prevModules) {
if(!this.modulesByIdentifier[identifier])
return this.modulesByIdentifier[identifier] = new ExtractedModule(identifier, originalModule, source, sourceMap, additionalInformation);
return this.modulesByIdentifier[identifier];
return this.modulesByIdentifier[identifier] = new ExtractedModule(identifier, originalModule, source, sourceMap, additionalInformation, prevModules);
var m = this.modulesByIdentifier[identifier];
m.addPrevModules(prevModules);
return m;
};

@@ -263,9 +273,11 @@

var counterMap = {};
var prevModules = [];
result.forEach(function(item) {
var c = counterMap[item[0]];
var i = item.slice();
var module = this.addModule.call(this, item[0] + (c || ""), originalModule, item[1], item[2], item[3]);
var module = this.addModule.call(this, item[0] + (c || ""), originalModule, item[1], item[2], item[3], prevModules.slice());
extractedChunk.addModule(module);
module.addChunk(extractedChunk);
counterMap[item[0]] = (c || 0) + 1;
prevModules.push(module);
}, this);

@@ -281,1 +293,13 @@ };

};
function getOrder(a, b) {
var bBeforeA = a.getPrevModules().indexOf(b) >= 0;
var aBeforeB = b.getPrevModules().indexOf(a) >= 0;
if(aBeforeB && bBeforeA)
return NaN;
if(bBeforeA)
return 1;
if(aBeforeB)
return -1;
return 0;
}

2

package.json
{
"name": "extract-text-webpack-plugin",
"version": "0.4.0",
"version": "0.5.0",
"author": "Tobias Koppers @sokra",

@@ -5,0 +5,0 @@ "description": "Extract text from bundle into a file.",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc