broccoli-asset-rewrite
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -119,7 +119,6 @@ var Filter = require('broccoli-filter'); | ||
replaceString = match[1].replace(assetPath, replacementPath); | ||
if (this.prepend && this.prepend !== '') { | ||
var removeLeadingSlashRegex = new RegExp('^/?(.*)$'); | ||
replaceString = this.prepend + removeLeadingSlashRegex.exec(replaceString)[1]; | ||
replaceString = this.prepend + replacementPath; | ||
} else { | ||
replaceString = match[1].replace(assetPath, replacementPath); | ||
} | ||
@@ -126,0 +125,0 @@ |
{ | ||
"name": "broccoli-asset-rewrite", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "broccoli plugin to rewrite a source tree from an asset map.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -159,46 +159,2 @@ var fs = require('fs'); | ||
}); | ||
it('maintains fragments', function () { | ||
var sourcePath = 'tests/fixtures/fragments'; | ||
var node = new AssetRewrite(sourcePath + '/input', { | ||
assetMap: { | ||
'images/defs.svg': 'images/fingerprinted-defs.svg' | ||
} | ||
}); | ||
builder = new broccoli.Builder(node); | ||
return builder.build().then(function (graph) { | ||
confirmOutput(graph.directory, sourcePath + '/output'); | ||
}); | ||
}); | ||
it('maintains fragments with prepend', function () { | ||
var sourcePath = 'tests/fixtures/fragments-prepend'; | ||
var node = new AssetRewrite(sourcePath + '/input', { | ||
assetMap: { | ||
'images/defs.svg': 'images/fingerprinted-defs.svg' | ||
}, | ||
prepend: 'https://cloudfront.net/' | ||
}); | ||
builder = new broccoli.Builder(node); | ||
return builder.build().then(function (graph) { | ||
confirmOutput(graph.directory, sourcePath + '/output'); | ||
}); | ||
}); | ||
it('replaces absolute URLs with prepend', function () { | ||
var sourcePath = 'tests/fixtures/absolute-prepend'; | ||
var node = new AssetRewrite(sourcePath + '/input', { | ||
assetMap: { | ||
'my-image.png': 'my-image-fingerprinted.png' | ||
}, | ||
prepend: 'https://cloudfront.net/' | ||
}); | ||
builder = new broccoli.Builder(node); | ||
return builder.build().then(function (graph) { | ||
confirmOutput(graph.directory, sourcePath + '/output'); | ||
}); | ||
}); | ||
}); |
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
22683
51
362