Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

broccoli-asset-rewrite

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-asset-rewrite - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

tests/fixtures/sourcemaps-prepend/input/abs.js

9

index.js

@@ -125,4 +125,9 @@ var Filter = require('broccoli-filter');

}
return newString.replace(new RegExp('sourceMappingURL=' + escapeRegExp(assetPath)), function(wholeMatch){
return wholeMatch.replace(assetPath, replacementPath);
var self = this;
return newString.replace(new RegExp('sourceMappingURL=' + escapeRegExp(assetPath)), function(wholeMatch) {
var replaceString = replacementPath;
if (self.prepend && self.prepend !== '' && (!/^sourceMappingURL=(http|https|\/\/)/.test(wholeMatch))) {
replaceString = self.prepend + replacementPath;
}
return wholeMatch.replace(assetPath, replaceString);
});

@@ -129,0 +134,0 @@ };

{
"name": "broccoli-asset-rewrite",
"version": "1.0.7",
"version": "1.0.8",
"description": "broccoli plugin to rewrite a source tree from an asset map.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -142,2 +142,19 @@ var fs = require('fs');

});
it('replaces source map URLs with prepend', function () {
var sourcePath = 'tests/fixtures/sourcemaps-prepend';
var tree = rewrite(sourcePath + '/input', {
replaceExtensions: ['js'],
assetMap: {
'the.map' : 'the-other-map',
'http://absolute.com/source.map' : 'http://cdn.absolute.com/other-map'
},
prepend: 'https://cloudfront.net/'
});
builder = new broccoli.Builder(tree);
return builder.build().then(function (graph) {
confirmOutput(graph.directory, sourcePath + '/output');
});
});
});
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