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

broccoli-sourcemap-concat

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-sourcemap-concat - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

14

concat-with-maps.js

@@ -23,13 +23,3 @@ var helpers = require('broccoli-kitchen-sink-helpers');

var firstSection = true;
var mapFile, mapURL;
if (this.mapDir) {
mapFile = path.join(
outDir,
this.mapDir,
path.basename(this.outputFile).replace(/\.\w+$/, '') + '.map'
);
mapURL = '/' + this.mapDir + '/' + path.basename(mapFile);
}
var concat = this.concat = new ConcatWithSourcemap({

@@ -39,5 +29,3 @@ outputFile: path.join(outDir, this.outputFile),

baseDir: inDir,
cache: this.encoderCache,
mapFile: mapFile,
mapURL: mapURL
cache: this.encoderCache
});

@@ -44,0 +32,0 @@

14

index.js
var SourceMapAwareConcat = require('./concat-with-maps');
var SimpleConcat = require('./simple-concat');
var merge = require('lodash-node/modern/objects/merge');

@@ -9,7 +10,10 @@ module.exports = function(inputTree, options) {

var extensions = (options.sourceMapsForExtensions || ['js']);
for (var i=0; i<extensions.length; i++) {
var ext = '.' + extensions[i].replace(/^\./,'');
if (options.outputFile.slice(-1 * ext.length) === ext) {
return new SourceMapAwareConcat(inputTree, options);
var config = merge({ enabled: true}, options.sourceMapConfig);
if (config.enabled) {
var extensions = (config.extensions || ['js']);
for (var i=0; i<extensions.length; i++) {
var ext = '.' + extensions[i].replace(/^\./,'');
if (options.outputFile.slice(-1 * ext.length) === ext) {
return new SourceMapAwareConcat(inputTree, options);
}
}

@@ -16,0 +20,0 @@ }

{
"name": "broccoli-sourcemap-concat",
"version": "0.3.0",
"version": "0.4.0",
"description": "Fast, good-enough concatenation with source maps.",

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

@@ -58,3 +58,3 @@ /* global describe, afterEach, it, expect */

header: "/* This is my header. */",
sourceMapsForExtensions: []
sourceMapConfig: { enabled: false }
});

@@ -73,3 +73,3 @@ builder = new broccoli.Builder(tree);

header: "/* This is my header. */",
sourceMapsForExtensions: []
sourceMapConfig: { extensions: [] }
});

@@ -124,3 +124,3 @@ builder = new broccoli.Builder(tree);

footerFiles: ['other/third.js', 'other/fourth.js'],
sourceMapsForExtensions: []
sourceMapConfig: { extensions: [] }
});

@@ -159,15 +159,2 @@ builder = new broccoli.Builder(tree);

it('can use mapDir', function(){
var tree = concat(fixtures, {
outputFile: '/assets/mapped.js',
inputFiles: ['inner/*.js'],
mapDir: 'maps'
});
builder = new broccoli.Builder(tree);
return builder.build().then(function(result) {
expectFile('mapped.js').in(result, 'assets');
expectFile('mapped.map').in(result, 'maps');
});
});
afterEach(function() {

@@ -174,0 +161,0 @@ if (builder) {

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