Created
June 20, 2017 14:24
-
-
Save doasync/71a0ab7712354aae994e5ac8a74d1624 to your computer and use it in GitHub Desktop.
Browserify mongoose js version for browser from 'node_modules' npm package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var gulpSequence = require('gulp-sequence'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var browserify = require('browserify'); | |
var uglify = require('gulp-uglify'); | |
gulp.task('mongoose', function() { | |
return browserify('./node_modules/mongoose/lib/browser.js') | |
.bundle() | |
.pipe(source('mongoose.min.js')) | |
.pipe(buffer()) | |
.pipe(uglify()) | |
.pipe(gulp.dest('./inject')); | |
}); | |
gulp.task('default', gulpSequence(['mongoose'])); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
do this work?