broccoli-filter
Advanced tools
Comparing version 0.1.13 to 0.1.14
# master | ||
# 0.1.14 | ||
* Improve performance by symlinking when possible | ||
# 0.1.13 | ||
@@ -4,0 +8,0 @@ |
15
index.js
@@ -10,2 +10,3 @@ var fs = require('fs') | ||
var mapSeries = require('promise-map-series') | ||
var symlinkOrCopySync = require('symlink-or-copy').sync | ||
@@ -45,4 +46,3 @@ | ||
} else { | ||
helpers.copyPreserveSync( | ||
srcDir + '/' + relativePath, destDir + '/' + relativePath) | ||
symlinkOrCopySync(srcDir + '/' + relativePath, destDir + '/' + relativePath) | ||
} | ||
@@ -83,3 +83,3 @@ } | ||
if (cacheEntry != null && cacheEntry.hash === hash(cacheEntry.inputFiles)) { | ||
copyFromCache(cacheEntry) | ||
symlinkOrCopyFromCache(cacheEntry) | ||
} else { | ||
@@ -107,11 +107,7 @@ return Promise.resolve() | ||
function copyFromCache (cacheEntry) { | ||
function symlinkOrCopyFromCache (cacheEntry) { | ||
for (var i = 0; i < cacheEntry.outputFiles.length; i++) { | ||
var dest = destDir + '/' + cacheEntry.outputFiles[i] | ||
mkdirp.sync(path.dirname(dest)) | ||
// We may be able to link as an optimization here, because we control | ||
// the cache directory; we need to be 100% sure though that we don't try | ||
// to hardlink symlinks, as that can lead to directory hardlinks on OS X | ||
helpers.copyPreserveSync( | ||
self.getCacheDir() + '/' + cacheEntry.cacheFiles[i], dest) | ||
symlinkOrCopySync(self.getCacheDir() + '/' + cacheEntry.cacheFiles[i], dest) | ||
} | ||
@@ -129,2 +125,3 @@ } | ||
cacheEntry.cacheFiles.push(cacheFile) | ||
helpers.copyPreserveSync( | ||
@@ -131,0 +128,0 @@ destDir + '/' + cacheEntry.outputFiles[i], |
{ | ||
"name": "broccoli-filter", | ||
"description": "Helper base class for Broccoli plugins that map input files into output files one-to-one", | ||
"version": "0.1.13", | ||
"version": "0.1.14", | ||
"author": "Jo Liss <joliss42@gmail.com>", | ||
@@ -18,10 +18,11 @@ "main": "index.js", | ||
"dependencies": { | ||
"broccoli-kitchen-sink-helpers": "^0.2.6", | ||
"broccoli-writer": "^0.1.1", | ||
"mkdirp": "^0.3.5", | ||
"promise-map-series": "^0.2.1", | ||
"quick-temp": "^0.1.2", | ||
"mkdirp": "^0.3.5", | ||
"rsvp": "^3.0.16", | ||
"broccoli-writer": "^0.1.1", | ||
"walk-sync": "^0.1.3", | ||
"broccoli-kitchen-sink-helpers": "^0.2.6", | ||
"promise-map-series": "^0.2.1" | ||
"symlink-or-copy": "^1.0.1", | ||
"walk-sync": "^0.1.3" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9032
8
128
+ Addedsymlink-or-copy@^1.0.1
+ Addedsymlink-or-copy@1.3.1(transitive)