gulp-hashify
Advanced tools
Comparing version 0.0.24 to 0.0.25
{ | ||
"name": "gulp-hashify", | ||
"version": "0.0.24", | ||
"version": "0.0.25", | ||
"description": "A gulp plugin for turning a stream of files into a JavaScript object.", | ||
@@ -5,0 +5,0 @@ "main": "hashify.js", |
@@ -86,2 +86,30 @@ # gulp-hashify | ||
### Browserify example | ||
This task will find all `.html` files in `./src/views` and bundle them into an external browserify bundle. The | ||
views object can then be imported via `var views = require('views');`, provided `./dist/js/views.js` is referred | ||
to in the HTML file. | ||
```javascript | ||
var gulp = require('gulp'); | ||
var browserify = require('browserify'); | ||
var hashify = require('gulp-hashify'); | ||
var source = require('vinyl-source-stream'); | ||
var buffer = require('vinyl-buffer'); | ||
var tap = require('gulp-tap'); | ||
gulp.task('js:views', function () { | ||
return gulp.src('./src/views/**/*.html') | ||
.pipe(hashify('bundled-views.js')) | ||
.pipe(tap(function(file) { | ||
return browserify() | ||
.require(file, { expose: 'views' }) | ||
.bundle() | ||
.pipe(source('views.js')) | ||
.pipe(buffer()) | ||
.pipe(gulp.dest('./dist/js')); | ||
})); | ||
}); | ||
``` | ||
--- | ||
@@ -97,2 +125,2 @@ | ||
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. | ||
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. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10768
125