gulp-preprocess
Advanced tools
Comparing version 3.0.3 to 4.0.0
var _ = require("lodash"); | ||
var map = require("map-stream"); | ||
var pp = require("preprocess"); | ||
var path = require("path"); | ||
var through = require('through2'); | ||
module.exports = function(options) { | ||
module.exports = function (options) { | ||
var opts = _.merge({}, options); | ||
var context = _.merge({}, process.env, opts.context); | ||
function ppStream(file, callback) { | ||
function ppStream(file, encoding, callback) { | ||
var contents, extension; | ||
@@ -33,3 +33,3 @@ | ||
return map(ppStream); | ||
return through.obj(ppStream); | ||
}; | ||
@@ -36,0 +36,0 @@ |
{ | ||
"name": "gulp-preprocess", | ||
"description": "Gulp plugin to preprocess HTML, JavaScript, and other files based on custom context or environment configuration", | ||
"version": "3.0.3", | ||
"version": "4.0.0", | ||
"homepage": "http://github.com/pioug/gulp-preprocess", | ||
@@ -14,9 +14,9 @@ "repository": { | ||
"lodash": "^4.17.15", | ||
"map-stream": "^0.1.x", | ||
"preprocess": "^3.0.0" | ||
"preprocess": "^3.0.0", | ||
"through2": "4.0.2" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^6.3.0", | ||
"mocha": "^6.2.0", | ||
"prettier": "^1.16.4", | ||
"eslint": "7.24.0", | ||
"mocha": "^8.3.2", | ||
"prettier": "^2.2.1", | ||
"should": "^13.2.3", | ||
@@ -26,3 +26,3 @@ "vinyl": "^2.2.0" | ||
"engines": { | ||
"node": ">= 6.14.3" | ||
"node": ">= 14" | ||
}, | ||
@@ -29,0 +29,0 @@ "scripts": { |
@@ -1,2 +0,2 @@ | ||
# gulp-preprocess [![NPM version](https://img.shields.io/npm/v/gulp-preprocess.svg)](https://www.npmjs.com/package/gulp-preprocess) [![Build Status](https://img.shields.io/travis/pioug/gulp-preprocess.svg)](https://travis-ci.org/pioug/gulp-preprocess) [![Dependency Status](https://img.shields.io/david/pioug/gulp-preprocess.svg)](https://david-dm.org/pioug/gulp-preprocess) | ||
# gulp-preprocess [![NPM version](https://img.shields.io/npm/v/gulp-preprocess.svg)](https://www.npmjs.com/package/gulp-preprocess) [![Run tests](https://github.com/nfroidure/svg-pathdata/actions/workflows/test.yml/badge.svg)](https://github.com/nfroidure/svg-pathdata/actions/workflows/test.yml) [![Dependency Status](https://img.shields.io/david/pioug/gulp-preprocess.svg)](https://david-dm.org/pioug/gulp-preprocess) | ||
@@ -36,3 +36,3 @@ > [Gulp](http://gulpjs.com) plugin to preprocess HTML, JavaScript, and other files based on custom context or environment configuration | ||
gulp.task("html", function() { | ||
gulp.task("html", function () { | ||
gulp | ||
@@ -44,7 +44,4 @@ .src("./app/*.html") | ||
gulp.task("scripts", function() { | ||
gulp | ||
.src(["./app/*.js"]) | ||
.pipe(preprocess()) | ||
.pipe(gulp.dest("./dist/")); | ||
gulp.task("scripts", function () { | ||
gulp.src(["./app/*.js"]).pipe(preprocess()).pipe(gulp.dest("./dist/")); | ||
}); | ||
@@ -57,3 +54,3 @@ ``` | ||
<head> | ||
<title>Your App | ||
<title>Your App</title> | ||
@@ -60,0 +57,0 @@ <!-- @if NODE_ENV='production' --> |
13150
119
+ Addedthrough2@4.0.2
+ Addedinherits@2.0.4(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedsafe-buffer@5.2.1(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedthrough2@4.0.2(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
- Removedmap-stream@^0.1.x
- Removedmap-stream@0.1.0(transitive)