ubdate
This commit is contained in:
20
node_modules/gulp-concat/LICENSE
generated
vendored
Executable file
20
node_modules/gulp-concat/LICENSE
generated
vendored
Executable file
@@ -0,0 +1,20 @@
|
||||
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.
|
||||
89
node_modules/gulp-concat/README.md
generated
vendored
Normal file
89
node_modules/gulp-concat/README.md
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||

|
||||
|
||||
## 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'));
|
||||
});
|
||||
```
|
||||
101
node_modules/gulp-concat/index.js
generated
vendored
Normal file
101
node_modules/gulp-concat/index.js
generated
vendored
Normal file
@@ -0,0 +1,101 @@
|
||||
'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);
|
||||
};
|
||||
73
node_modules/gulp-concat/package.json
generated
vendored
Normal file
73
node_modules/gulp-concat/package.json
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
{
|
||||
"_from": "gulp-concat",
|
||||
"_id": "gulp-concat@2.6.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=",
|
||||
"_location": "/gulp-concat",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "tag",
|
||||
"registry": true,
|
||||
"raw": "gulp-concat",
|
||||
"name": "gulp-concat",
|
||||
"escapedName": "gulp-concat",
|
||||
"rawSpec": "",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "latest"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/",
|
||||
"#USER"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/gulp-concat/-/gulp-concat-2.6.1.tgz",
|
||||
"_shasum": "633d16c95d88504628ad02665663cee5a4793353",
|
||||
"_spec": "gulp-concat",
|
||||
"_where": "/var/www/html/jason/WeihnachtenMelly",
|
||||
"author": {
|
||||
"name": "Contra",
|
||||
"email": "yo@contra.io",
|
||||
"url": "http://contra.io/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/contra/gulp-concat/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"dependencies": {
|
||||
"concat-with-sourcemaps": "^1.0.0",
|
||||
"through2": "^2.0.0",
|
||||
"vinyl": "^2.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Concatenates files",
|
||||
"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"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/contra/gulp-concat#readme",
|
||||
"keywords": [
|
||||
"gulpplugin"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "gulp-concat",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/contra/gulp-concat.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "istanbul cover _mocha",
|
||||
"test": "mocha"
|
||||
},
|
||||
"version": "2.6.1"
|
||||
}
|
||||
Reference in New Issue
Block a user