Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
grunt-depend-concat
Advanced tools
A Grunt task that concatenates files in order via path references.
This task was initially developed to be used in conjunction with grunt-ts for concatenating separately compiled JavaScript files. However, the task's functionality has been expanded to be useful in a variety of ways.
Written in TypeScript.
This plugin requires Grunt ~0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-depend-concat --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-depend-concat');
The method option determines what the task searches for to find dependencies.
doctag
Setting the method.type
option to "doctag"
will have the task recognize documentation tags matching the method.tag
string.
For example, the following method options ...
{
method: {
type: 'doctag',
tag: 'use'
}
}
... will recognize the following tags as dependencies:
/**
* @use ../path/to/file.js
*/
xmltag
Setting the method.type
option to "xmltag"
will have the task recognize documentation tags matching the method.tag
string.
For example, the following method options ...
{
method: {
type: 'xmltag',
tag: 'use'
}
}
... will recognize the following tags as dependencies:
// <use path="../path/to/file.ts" />
/// <use path="../path/to/file.ts" />
The xmltag
type has additional options.
The method.attribute
and method.prefix
options will alter the regular expression used for finding dependencies.
For example, the following method options ...
{
method: {
type: 'xmltag',
tag: 'require',
attribute: 'src',
prefix: '<\\!-- *'
}
}
... will recognize the following tags as dependencies:
<!-- <require src="../path/to/file.ts" />
Set the method
option to "reference"
for TypeScript references to be recognized. The following is an example reference.
/// <reference path="../path/to/file.ts" />
You can also use a custom method by providing the method
option to a literal object with the regex
and index
properties set.
{
/**
* A regular expression used to find the dependencies
*/
regex: /somefancyregex/gi,
/**
* An array index where each dependency's file path
* can be found from the result of RegExp.exec()
*/
index: 1
}
File contents separator. Default: "\n"
When looking for matching dependency files, the file extensions are ignored. Allows TypeScript references (.ts) to discover their compiled (.js) counterparts. Default: true
grunt.initConfig({
'depend-concat': {
/*
@depends /path/to/dependency.js
*/
depends_doctag: {
options: {
method: {
type: 'doctag',
tag: 'depends'
}
}
src: ['compiled/files/*.js'],
dest: 'dist/concat.js'
},
/*
/// <reference path="../path/to/file.ts" />
*/
typescript_reference: {
options: {
method: 'reference'
},
src: ['compiled/files/*.js'],
dest: 'dist/concat.js'
},
/*
<!-- <require filepath="../path/to/file.xml" /> -->
*/
require_xmltag: {
options: {
method: : {
type: 'doctag',
tag: 'require',
attribute: 'filepath',
prefix: '<\\!-- *'
},
ignore_ext: false,
},
src: ['compiled/files/*.xml'],
dest: 'dist/concat.xml'
},
}
});
Released under the MIT license
FAQs
Concatenates files in order via path references
We found that grunt-depend-concat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.