grunt-contrib-concat
Advanced tools
Comparing version 0.3.0 to 0.4.0
{ | ||
"name": "grunt-contrib-concat", | ||
"description": "Concatenate files.", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"homepage": "https://github.com/gruntjs/grunt-contrib-concat", | ||
@@ -23,3 +23,2 @@ "author": { | ||
], | ||
"main": "Gruntfile.js", | ||
"engines": { | ||
@@ -31,6 +30,9 @@ "node": ">= 0.8.0" | ||
}, | ||
"dependencies": { | ||
"chalk": "~0.4.0" | ||
}, | ||
"devDependencies": { | ||
"grunt-contrib-jshint": "~0.2.0", | ||
"grunt-contrib-nodeunit": "~0.1.2", | ||
"grunt-contrib-clean": "~0.4.0", | ||
"grunt-contrib-jshint": "~0.9.2", | ||
"grunt-contrib-nodeunit": "~0.3.0", | ||
"grunt-contrib-clean": "~0.5.0", | ||
"grunt-contrib-internal": "~0.4.2", | ||
@@ -44,3 +46,7 @@ "grunt": "~0.4.0" | ||
"gruntplugin" | ||
], | ||
"files": [ | ||
"tasks", | ||
"LICENSE-MIT" | ||
] | ||
} |
@@ -1,2 +0,2 @@ | ||
# grunt-contrib-concat [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-concat.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-concat) | ||
# grunt-contrib-concat v0.4.0 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-concat.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-concat) | ||
@@ -28,3 +28,4 @@ > Concatenate files. | ||
Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. | ||
Task targets, files and options may be specified according to the Grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. | ||
### Options | ||
@@ -68,10 +69,10 @@ | ||
#### process | ||
Type: `Boolean` `Object` | ||
Type: `Boolean` `Object` `Function` | ||
Default: `false` | ||
Process source files as [templates][] before concatenating. | ||
Process source files before concatenating, either as [templates][] or with a custom function. | ||
* `false` - No processing will occur. | ||
* `true` - Process source files using [grunt.template.process][] defaults. | ||
* `options` object - Process source files using [grunt.template.process][], using the specified options. | ||
* `data` object - Process source files using [grunt.template.process][], using the specified options. | ||
* `function(src, filepath)` - Process source files using the given function, called once for each file. The returned value will be used as source code. | ||
@@ -81,4 +82,4 @@ | ||
[templates]: https://github.com/gruntjs/grunt/wiki/grunt.template | ||
[grunt.template.process]: https://github.com/gruntjs/grunt/wiki/grunt.template#wiki-grunt-template-process | ||
[templates]: https://github.com/gruntjs/grunt-docs/blob/master/grunt.template.md | ||
[grunt.template.process]: https://github.com/gruntjs/grunt-docs/blob/master/grunt.template.md#grunttemplateprocess | ||
@@ -89,3 +90,3 @@ ### Usage Examples | ||
In this example, running `grunt concat:dist` (or `grunt concat` because `concat` is a [multi task][]) will concatenate the three specified source files (in order), joining files with `;` and writing the output to `dist/built.js`. | ||
In this example, running `grunt concat:dist` (or `grunt concat` because `concat` is a [multi task][multitask]) will concatenate the three specified source files (in order), joining files with `;` and writing the output to `dist/built.js`. | ||
@@ -97,9 +98,9 @@ ```js | ||
options: { | ||
separator: ';' | ||
separator: ';', | ||
}, | ||
dist: { | ||
src: ['src/intro.js', 'src/project.js', 'src/outro.js'], | ||
dest: 'dist/built.js' | ||
} | ||
} | ||
dest: 'dist/built.js', | ||
}, | ||
}, | ||
}); | ||
@@ -124,9 +125,9 @@ ``` | ||
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' + | ||
'<%= grunt.template.today("yyyy-mm-dd") %> */' | ||
'<%= grunt.template.today("yyyy-mm-dd") %> */', | ||
}, | ||
dist: { | ||
src: ['src/project.js'], | ||
dest: 'dist/built.js' | ||
} | ||
} | ||
dest: 'dist/built.js', | ||
}, | ||
}, | ||
}); | ||
@@ -139,3 +140,3 @@ ``` | ||
While each concat target can be built individually by running `grunt concat:basic` or `grunt concat:extras`, running `grunt concat` will build all concat targets. This is because `concat` is a [multi task][]. | ||
While each concat target can be built individually by running `grunt concat:basic` or `grunt concat:extras`, running `grunt concat` will build all concat targets. This is because `concat` is a [multi task][multitask]. | ||
@@ -148,9 +149,9 @@ ```js | ||
src: ['src/main.js'], | ||
dest: 'dist/basic.js' | ||
dest: 'dist/basic.js', | ||
}, | ||
extras: { | ||
src: ['src/main.js', 'src/extras.js'], | ||
dest: 'dist/with_extras.js' | ||
} | ||
} | ||
dest: 'dist/with_extras.js', | ||
}, | ||
}, | ||
}); | ||
@@ -174,6 +175,6 @@ ``` | ||
'dist/basic.js': ['src/main.js'], | ||
'dist/with_extras.js': ['src/main.js', 'src/extras.js'] | ||
} | ||
} | ||
} | ||
'dist/with_extras.js': ['src/main.js', 'src/extras.js'], | ||
}, | ||
}, | ||
}, | ||
}); | ||
@@ -195,5 +196,5 @@ ``` | ||
src: ['src/main.js'], | ||
dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js' | ||
} | ||
} | ||
dest: 'dist/<%= pkg.name %>-<%= pkg.version %>.js', | ||
}, | ||
}, | ||
}); | ||
@@ -204,7 +205,7 @@ ``` | ||
In this more involved example, running `grunt concat` will build two separate files (because `concat` is a [multi task][]). The destination file paths will be expanded dynamically based on the specified templates, recursively if necessary. | ||
In this more involved example, running `grunt concat` will build two separate files (because `concat` is a [multi task][multitask]). The destination file paths will be expanded dynamically based on the specified templates, recursively if necessary. | ||
For example, if the `package.json` file contained `{"name": "awesome", "version": "1.0.0"}`, the files `dist/awesome/1.0.0/basic.js` and `dist/awesome/1.0.0/with_extras.js` would be generated. | ||
```javascript | ||
```js | ||
// Project configuration. | ||
@@ -215,3 +216,3 @@ grunt.initConfig({ | ||
src: 'src/files', | ||
dest: 'dist/<%= pkg.name %>/<%= pkg.version %>' | ||
dest: 'dist/<%= pkg.name %>/<%= pkg.version %>', | ||
}, | ||
@@ -221,9 +222,9 @@ concat: { | ||
src: ['<%= dirs.src %>/main.js'], | ||
dest: '<%= dirs.dest %>/basic.js' | ||
dest: '<%= dirs.dest %>/basic.js', | ||
}, | ||
extras: { | ||
src: ['<%= dirs.src %>/main.js', '<%= dirs.src %>/extras.js'], | ||
dest: '<%= dirs.dest %>/with_extras.js' | ||
} | ||
} | ||
dest: '<%= dirs.dest %>/with_extras.js', | ||
}, | ||
}, | ||
}); | ||
@@ -254,3 +255,3 @@ ``` | ||
```js | ||
runt.initConfig({ | ||
grunt.initConfig({ | ||
concat: { | ||
@@ -274,6 +275,10 @@ dist: { | ||
[multitask]: http://gruntjs.com/creating-tasks#multi-tasks | ||
## Release History | ||
* 2014-03-21 v0.4.0 README updates. Output updates. | ||
* 2013-04-25 v0.3.0 Add option to process files with a custom function. | ||
* 2013-04-08 v0.2.0 Dont normalize separator to allow user to set LF even on a Windows environment. | ||
* 2013-04-08 v0.2.0 Don't normalize separator to allow user to set LF even on a Windows environment. | ||
* 2013-02-22 v0.1.3 Support footer option. | ||
@@ -290,2 +295,2 @@ * 2013-02-15 v0.1.2 First official release for Grunt 0.4.0. | ||
*This file was generated on Thu Apr 25 2013 20:22:44.* | ||
*This file was generated on Mon Mar 31 2014 11:20:28.* |
@@ -5,3 +5,3 @@ /* | ||
* | ||
* Copyright (c) 2012 "Cowboy" Ben Alman, contributors | ||
* Copyright (c) 2014 "Cowboy" Ben Alman, contributors | ||
* Licensed under the MIT license. | ||
@@ -16,2 +16,3 @@ */ | ||
var comment = require('./lib/comment').init(grunt); | ||
var chalk = require('chalk'); | ||
@@ -67,3 +68,3 @@ grunt.registerMultiTask('concat', 'Concatenate files.', function() { | ||
// Print a success message. | ||
grunt.log.writeln('File "' + f.dest + '" created.'); | ||
grunt.log.writeln('File ' + chalk.cyan(f.dest) + ' created.'); | ||
}); | ||
@@ -70,0 +71,0 @@ }); |
@@ -5,3 +5,3 @@ /* | ||
* | ||
* Copyright (c) 2012 "Cowboy" Ben Alman, contributors | ||
* Copyright (c) 2013 "Cowboy" Ben Alman, contributors | ||
* Licensed under the MIT license. | ||
@@ -8,0 +8,0 @@ */ |
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
281
15034
2
5
89
1
+ Addedchalk@~0.4.0
+ Addedansi-styles@1.0.0(transitive)
+ Addedchalk@0.4.0(transitive)
+ Addedhas-color@0.1.7(transitive)
+ Addedstrip-ansi@0.1.1(transitive)