Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/janhancic/grunt-stitch-js
A grunt task that can stitch together multiple files into one based on the provided template.
https://github.com/janhancic/grunt-stitch-js
Last synced: 22 days ago
JSON representation
A grunt task that can stitch together multiple files into one based on the provided template.
- Host: GitHub
- URL: https://github.com/janhancic/grunt-stitch-js
- Owner: janhancic
- License: mit
- Created: 2013-09-19T22:59:23.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-02-21T16:52:44.000Z (almost 9 years ago)
- Last Synced: 2024-11-20T05:51:36.913Z (about 1 month ago)
- Language: JavaScript
- Homepage: http://hancic.info/grunt-stitch-js
- Size: 113 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# grunt-stitch-js
A grunt task that can stitch together multiple files into one based on the provided template.
## What does it do?
This grunt task will automatically join multiple files into one file in the order you have defined in your stitch template file.A stitch template file could look something like this:
```javascript
/*# src.js #*//* you can put arbitrary JavaScript code wherever in this file */
/*# some_file.js */
```If we then had the files `src.js` and `some_file.js` and ran the `stitch` task, we would get a new file that would look something like this:
```javascript
contents of src.js file/* you can put arbitrary JavaScript code wherever in this file */
contents of some_file.js file
```## Installation
Install the plugin with `npm`:```shell
npm install grunt-stitch-js --save-dev
```
Load the task in your `Gruntfile.js`:```javascript
grunt.loadNpmTasks('grunt-stitch-js');
```_Note_: NPM registry page for this plugin can be found [here](https://npmjs.org/package/grunt-stitch-js).
## Configuration
In order for the task to work it needs to know about two files:
- `templateFile`: the file to use as the template
- `out`: the file to write the result toTo configure the task put this into your `Gruntfile.js`.
```javascript
grunt.initConfig( {
'stitch-js': {
all: {
templateFile: 'path/to/template.js',
out: 'path/to/out.js'
}
}
} );
```_Note_: you can have multiple targets (invoked with `grunt stitch-js:target_name`). `all` is one such target.
Please referrer to the Grunt [Getting Started](http://gruntjs.com/getting-started) guide, if you haven't used Grunt before and need help.
## License
Licensed under MIT. See [LICENSE.md](https://github.com/janhancic/grunt-stitch-js/blob/master/LICENSE.md) file for details.[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/janhancic/grunt-stitch-js/trend.png)](https://bitdeli.com/free "Bitdeli Badge")