Socket
Socket
Sign inDemoInstall

webpack-core

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webpack-core - npm Package Compare versions

Comparing version 0.1.5 to 0.2.0

lib/ConcatSource.js

9

lib/NormalModuleMixin.js

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

var RawSource = require("./RawSource");
var OriginalSource = require("./OriginalSource");
var path = require("path"); // TODO refactor

@@ -238,6 +239,10 @@

function onModuleBuild(source) {
function onModuleBuild(source, sourceMap) {
if(!Buffer.isBuffer(source) && typeof source !== "string")
return onModuleBuildFailed.call(this, new Error("Final loader didn't returned Buffer or String"));
this._source = new RawSource(source);
if(this.identifier) {
this._source = new OriginalSource(source, this.identifier(), sourceMap);
} else {
this._source = new RawSource(source);
}
return callback();

@@ -244,0 +249,0 @@ }

@@ -5,2 +5,5 @@ /*

*/
var SourceNode = require("source-map").SourceNode;
var SourceMapConsumer = require("source-map").SourceMapConsumer;
function Source() {

@@ -26,6 +29,10 @@ this._result = null;

};
Source.prototype.origins = function() {
Source.prototype.node = function() {
if(!this._result)
this._result = this._bake();
return this._result.origins;
if(this._result.node)
return this._result.node;
if(this._result.map)
return SourceNode.fromStringWithSourceMap(this._result.source, new SourceMapConsumer(this._result.map));
return new SourceNode(null, null, null, this._result.source);
};

@@ -36,5 +43,4 @@ Source.prototype.updateHash = function(hash) {

hash.update(this._result.source || "");
// TODO
// hash.update(this._result.map || "");
// hash.update(this._result.origins || "");
if(this._result.map)
hash.update(JSON.stringify(this._result.map));
};
{
"name": "webpack-core",
"version": "0.1.5",
"version": "0.2.0",
"author": "Tobias Koppers @sokra",
"description": "The core of webpack and enhanced-require.",
"dependencies": {
"source-map": "https://github.com/sokra/source-map/archive/master.tar.gz"
},

@@ -8,0 +9,0 @@ "licenses": [

@@ -8,2 +8,3 @@ # webpack-core

* the loader stuff
* SourceMap stuff

@@ -10,0 +11,0 @@ Not useable as standalone module, but this may change in the future.

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