This commit is contained in:
sentsin
2017-08-21 08:50:25 +08:00
parent 06c11ba9cd
commit 7feaa4eca0
1899 changed files with 181363 additions and 22513 deletions

4
node_modules/vinyl-sourcemaps-apply/.jshintrc generated vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"node": true,
"strict": true
}

2
node_modules/vinyl-sourcemaps-apply/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,2 @@
.DS_Store
node_modules

42
node_modules/vinyl-sourcemaps-apply/README.md generated vendored Normal file
View File

@@ -0,0 +1,42 @@
# vinyl-sourcemaps-apply
Apply a source map to a vinyl file, merging it with preexisting source maps.
## Usage:
```javascript
var applySourceMap = require('vinyl-sourcemaps-apply');
applySourceMap(vinylFile, sourceMap);
```
### Example (Gulp plugin):
```javascript
var through = require('through2');
var applySourceMap = require('vinyl-sourcemaps-apply');
var myTransform = require('myTransform');
module.exports = function(options) {
function transform(file, encoding, callback) {
// generate source maps if plugin source-map present
if (file.sourceMap) {
options.makeSourceMaps = true;
}
// do normal plugin logic
var result = myTransform(file.contents, options);
file.contents = new Buffer(result.code);
// apply source map to the chain
if (file.sourceMap) {
applySourceMap(file, result.map);
}
this.push(file);
callback();
}
return through.obj(transform);
};
```

39
node_modules/vinyl-sourcemaps-apply/index.js generated vendored Normal file
View File

@@ -0,0 +1,39 @@
'use strict';
var SourceMapGenerator = require('source-map').SourceMapGenerator;
var SourceMapConsumer = require('source-map').SourceMapConsumer;
module.exports = function applySourceMap(file, sourceMap) {
if (typeof sourceMap === 'string' || sourceMap instanceof String) {
sourceMap = JSON.parse(sourceMap);
}
if (file.sourceMap && (typeof file.sourceMap === 'string' || file.sourceMap instanceof String)) {
file.sourceMap = JSON.parse(file.sourceMap);
}
// check source map properties
assertProperty(sourceMap, "file");
assertProperty(sourceMap, "mappings");
assertProperty(sourceMap, "sources");
// fix paths if Windows style paths
sourceMap.file = sourceMap.file.replace(/\\/g, '/');
sourceMap.sources = sourceMap.sources.map(function(filePath) {
return filePath.replace(/\\/g, '/');
});
if (file.sourceMap && file.sourceMap.mappings !== '') {
var generator = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(sourceMap));
generator.applySourceMap(new SourceMapConsumer(file.sourceMap));
file.sourceMap = JSON.parse(generator.toString());
} else {
file.sourceMap = sourceMap;
}
};
function assertProperty(sourceMap, propertyName) {
if (!sourceMap.hasOwnProperty(propertyName)) {
var e = new Error('Source map to be applied is missing the \"' + propertyName + '\" property');
throw e;
}
}

89
node_modules/vinyl-sourcemaps-apply/package.json generated vendored Normal file
View File

@@ -0,0 +1,89 @@
{
"_args": [
[
{
"raw": "vinyl-sourcemaps-apply@^0.2.0",
"scope": null,
"escapedName": "vinyl-sourcemaps-apply",
"name": "vinyl-sourcemaps-apply",
"rawSpec": "^0.2.0",
"spec": ">=0.2.0 <0.3.0",
"type": "range"
},
"D:\\web\\layui\\res\\layui\\node_modules\\gulp-minify-css"
]
],
"_from": "vinyl-sourcemaps-apply@>=0.2.0 <0.3.0",
"_id": "vinyl-sourcemaps-apply@0.2.1",
"_inCache": true,
"_location": "/vinyl-sourcemaps-apply",
"_nodeVersion": "0.12.7",
"_npmUser": {
"name": "floridoo",
"email": "florian.reiterer@gmail.com"
},
"_npmVersion": "2.11.3",
"_phantomChildren": {},
"_requested": {
"raw": "vinyl-sourcemaps-apply@^0.2.0",
"scope": null,
"escapedName": "vinyl-sourcemaps-apply",
"name": "vinyl-sourcemaps-apply",
"rawSpec": "^0.2.0",
"spec": ">=0.2.0 <0.3.0",
"type": "range"
},
"_requiredBy": [
"/gulp-minify-css",
"/gulp-uglify"
],
"_resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz",
"_shasum": "ab6549d61d172c2b1b87be5c508d239c8ef87705",
"_shrinkwrap": null,
"_spec": "vinyl-sourcemaps-apply@^0.2.0",
"_where": "D:\\web\\layui\\res\\layui\\node_modules\\gulp-minify-css",
"author": {
"name": "Florian Reiterer",
"email": "me@florianreiterer.com"
},
"bugs": {
"url": "https://github.com/floridoo/vinyl-sourcemaps-apply/issues"
},
"dependencies": {
"source-map": "^0.5.1"
},
"description": "Apply a source map to a vinyl file, merging it with preexisting source maps",
"devDependencies": {},
"directories": {},
"dist": {
"shasum": "ab6549d61d172c2b1b87be5c508d239c8ef87705",
"tarball": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.2.1.tgz"
},
"gitHead": "30320c97c112f44ccba02dd73ce5bed1ad4361de",
"homepage": "http://github.com/floridoo/vinyl-sourcemaps-apply",
"keywords": [
"vinyl",
"sourcemaps",
"source maps",
"gulp"
],
"license": "ISC",
"main": "index.js",
"maintainers": [
{
"name": "floridoo",
"email": "florian.reiterer@gmail.com"
}
],
"name": "vinyl-sourcemaps-apply",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git://github.com/floridoo/vinyl-sourcemaps-apply.git"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"version": "0.2.1"
}