diff options
Diffstat (limited to 'node_modules/gulp-concat')
-rwxr-xr-x | node_modules/gulp-concat/LICENSE | 20 | ||||
-rw-r--r-- | node_modules/gulp-concat/README.md | 89 | ||||
-rw-r--r-- | node_modules/gulp-concat/index.js | 101 | ||||
-rw-r--r-- | node_modules/gulp-concat/package.json | 36 |
4 files changed, 0 insertions, 246 deletions
diff --git a/node_modules/gulp-concat/LICENSE b/node_modules/gulp-concat/LICENSE deleted file mode 100755 index f75f2c75e..000000000 --- a/node_modules/gulp-concat/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2016 Contra <yo@contra.io> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/gulp-concat/README.md b/node_modules/gulp-concat/README.md deleted file mode 100644 index 9b96dc073..000000000 --- a/node_modules/gulp-concat/README.md +++ /dev/null @@ -1,89 +0,0 @@ - - -## Installation - -Install package with NPM and add it to your development dependencies: - -`npm install --save-dev gulp-concat` - -## Information - -<table> -<tr> -<td>Package</td><td>gulp-concat</td> -</tr> -<tr> -<td>Description</td> -<td>Concatenates files</td> -</tr> -<tr> -<td>Node Version</td> -<td>>= 0.10</td> -</tr> -</table> - -## Usage - -```js -var concat = require('gulp-concat'); - -gulp.task('scripts', function() { - return gulp.src('./lib/*.js') - .pipe(concat('all.js')) - .pipe(gulp.dest('./dist/')); -}); -``` - -This will concat files by your operating systems newLine. It will take the base directory from the first file that passes through it. - -Files will be concatenated in the order that they are specified in the `gulp.src` function. For example, to concat `./lib/file3.js`, `./lib/file1.js` and `./lib/file2.js` in that order, the following code will create a task to do that: - -```js -var concat = require('gulp-concat'); - -gulp.task('scripts', function() { - return gulp.src(['./lib/file3.js', './lib/file1.js', './lib/file2.js']) - .pipe(concat('all.js')) - .pipe(gulp.dest('./dist/')); -}); -``` - -To change the newLine simply pass an object as the second argument to concat with newLine being whatever (\r\n if you want to support any OS to look at it) - -For instance: - -```js -.pipe(concat('main.js', {newLine: ';'})) -``` - -To specify `cwd`, `path` and other [vinyl](https://github.com/wearefractal/vinyl) properties, gulp-concat accepts `Object` as first argument: - -```js -var concat = require('gulp-concat'); - -gulp.task('scripts', function() { - return gulp.src(['./lib/file3.js', './lib/file1.js', './lib/file2.js']) - .pipe(concat({ path: 'new.js', stat: { mode: 0666 }})) - .pipe(gulp.dest('./dist')); -}); -``` - -This will concat files into `./dist/new.js`. - -### Source maps - -Source maps can be generated by using [gulp-sourcemaps](https://www.npmjs.org/package/gulp-sourcemaps): - -```js -var gulp = require('gulp'); -var concat = require('gulp-concat'); -var sourcemaps = require('gulp-sourcemaps'); - -gulp.task('javascript', function() { - return gulp.src('src/**/*.js') - .pipe(sourcemaps.init()) - .pipe(concat('all.js')) - .pipe(sourcemaps.write()) - .pipe(gulp.dest('dist')); -}); -``` diff --git a/node_modules/gulp-concat/index.js b/node_modules/gulp-concat/index.js deleted file mode 100644 index c58866980..000000000 --- a/node_modules/gulp-concat/index.js +++ /dev/null @@ -1,101 +0,0 @@ -'use strict'; - -var through = require('through2'); -var path = require('path'); -var File = require('vinyl'); -var Concat = require('concat-with-sourcemaps'); - -// file can be a vinyl file object or a string -// when a string it will construct a new one -module.exports = function(file, opt) { - if (!file) { - throw new Error('gulp-concat: Missing file option'); - } - opt = opt || {}; - - // to preserve existing |undefined| behaviour and to introduce |newLine: ""| for binaries - if (typeof opt.newLine !== 'string') { - opt.newLine = '\n'; - } - - var isUsingSourceMaps = false; - var latestFile; - var latestMod; - var fileName; - var concat; - - if (typeof file === 'string') { - fileName = file; - } else if (typeof file.path === 'string') { - fileName = path.basename(file.path); - } else { - throw new Error('gulp-concat: Missing path in file options'); - } - - function bufferContents(file, enc, cb) { - // ignore empty files - if (file.isNull()) { - cb(); - return; - } - - // we don't do streams (yet) - if (file.isStream()) { - this.emit('error', new Error('gulp-concat: Streaming not supported')); - cb(); - return; - } - - // enable sourcemap support for concat - // if a sourcemap initialized file comes in - if (file.sourceMap && isUsingSourceMaps === false) { - isUsingSourceMaps = true; - } - - // set latest file if not already set, - // or if the current file was modified more recently. - if (!latestMod || file.stat && file.stat.mtime > latestMod) { - latestFile = file; - latestMod = file.stat && file.stat.mtime; - } - - // construct concat instance - if (!concat) { - concat = new Concat(isUsingSourceMaps, fileName, opt.newLine); - } - - // add file to concat instance - concat.add(file.relative, file.contents, file.sourceMap); - cb(); - } - - function endStream(cb) { - // no files passed in, no file goes out - if (!latestFile || !concat) { - cb(); - return; - } - - var joinedFile; - - // if file opt was a file path - // clone everything from the latest file - if (typeof file === 'string') { - joinedFile = latestFile.clone({contents: false}); - joinedFile.path = path.join(latestFile.base, file); - } else { - joinedFile = new File(file); - } - - joinedFile.contents = concat.content; - - if (concat.sourceMapping) { - joinedFile.sourceMap = JSON.parse(concat.sourceMap); - } - - this.push(joinedFile); - cb(); - } - - return through.obj(bufferContents, endStream); -}; diff --git a/node_modules/gulp-concat/package.json b/node_modules/gulp-concat/package.json deleted file mode 100644 index db176c435..000000000 --- a/node_modules/gulp-concat/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "gulp-concat", - "description": "Concatenates files", - "version": "2.6.1", - "repository": "contra/gulp-concat", - "author": "Contra <yo@contra.io> (http://contra.io/)", - "files": [ - "index.js" - ], - "keywords": [ - "gulpplugin" - ], - "dependencies": { - "concat-with-sourcemaps": "^1.0.0", - "through2": "^2.0.0", - "vinyl": "^2.0.0" - }, - "devDependencies": { - "gulp": "^3.8.7", - "gulp-sourcemaps": "^2.2.0", - "istanbul": "^0.4.5", - "mocha": "^3.0.0", - "mocha-lcov-reporter": "^1.2.0", - "should": "^11.0.0", - "stream-array": "^1.0.1", - "stream-assert": "^2.0.1" - }, - "scripts": { - "test": "mocha", - "coverage": "istanbul cover _mocha" - }, - "engines": { - "node": ">= 0.10" - }, - "license": "MIT" -} |