New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

racer-bundle

Package Overview
Dependencies
Maintainers
3
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

racer-bundle - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

37

index.js

@@ -0,5 +1,7 @@

var fs = require('fs');
var browserify = require('browserify');
var watchify = require('watchify');
var uglify = require('uglify-js');
var watchify = require('watchify');
var convertSourceMap = require('convert-source-map');
var anymatch = require('anymatch');

@@ -33,4 +35,2 @@ var util;

delay: 100,
// Ignore derby views since they are updated seperately
ignoreWatch: '**/derby/lib/*_views.js'
});

@@ -42,5 +42,17 @@

// This gets fired everytime a dependent file is changed
var ignore = (options.ignore == null) ? [] : options.ignore
// Chokidar/watchify provide the realpath's of files as their ids, so we
// add any realpath values that don't match the provided filepath's.
ignore.forEach(function(filepath) {
var realpath = fs.realpathSync(filepath);
if (realpath !== filepath) ignore.push(realpath);
});
var matchIgnorePaths = anymatch(ignore)
// This gets fired every time a dependent file is changed
w.on('update', function(ids) {
console.log('Files changed:', ids.toString());
// If all the changed files are ignoreable, return before bundling
if (ids.every(matchIgnorePaths)) {
return console.log('Ignoring update')
}
callBundle(this, minify, options.onRebundle);

@@ -70,8 +82,15 @@ });

outSourceMap: 'map',
inSourceMap: inSourceMap
inSourceMap: inSourceMap,
compress: false
});
var mapObject = JSON.parse(result.map);
// Uglify doesn't include the source content in the map, so copy over from
// the map that browserify generates
var mapObject = JSON.parse(result.map);
mapObject.sourcesContent = inSourceMap.sourcesContent;
// the map that browserify generates. However, before doing this, we must
// first remove any empty sourceContent items since UglifyJS ignores those
// files when populating the outSourceMap.sources array.
mapObject.sourcesContent = inSourceMap.sourcesContent.filter(isNotEmptyString)
if (mapObject.sources.length != mapObject.sourcesContent.length) {
console.error('Invalid sourcemap detected. sources.length does not match sourcesContent.length')
}
var map = JSON.stringify(mapObject);

@@ -81,1 +100,3 @@ cb(null, result.code, map);

}
function isNotEmptyString(str) { return str !== '' }
{
"name": "racer-bundle",
"version": "0.2.4",
"version": "0.2.5",
"description": "Create Browserify package for a Racer or Derby app",

@@ -19,3 +19,4 @@ "main": "index.js",

"dependencies": {
"browserify": "^12.0.1",
"anymatch": "^1.3.0",
"browserify": "^13.0.1",
"convert-source-map": "^1.1.1",

@@ -22,0 +23,0 @@ "uglify-js": "^2.4.24",

Sorry, the diff of this file is not supported yet

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