Skip to content

Commit

Permalink
Working on
Browse files Browse the repository at this point in the history
  • Loading branch information
n.lyubchich committed Jul 27, 2015
1 parent 340165f commit 88b5861
Show file tree
Hide file tree
Showing 98 changed files with 301 additions and 34,741 deletions.
6 changes: 4 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
],
"dependencies": {
"bootstrap": "~3.3.5",
"bootstrap-stylus": "~4.0.5",
"bootstrap-select": "~1.6.5",
"blueimp-bootstrap-image-gallery": "~3.1.2"
"blueimp-bootstrap-image-gallery": "~3.1.3",
"jquery": "~2.1.4",
"react": "~0.13.3",
"underscore": "~1.8.3"
}
}
38 changes: 38 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,36 @@ var rename = require('gulp-rename');
var source = require('vinyl-source-stream');
var stylus = require('gulp-stylus');
var uglify = require('gulp-uglify');
var _ = require('lodash');
var bowerResolve = require('bower-resolve');



gulp.task('build', ['build:scripts', 'build:styles']);


gulp.task('build:scripts:vendor', function() {
var b = browserify({
// generate source maps in non-production environment
debug: true
});

getBowerPackageIds().forEach(function (id) {

var resolvedPath = bowerResolve.fastReadSync(id);

b.require(resolvedPath, {
expose: id
});
});

var stream = b.bundle()
.pipe(source('vendor.js'))
.pipe(gulp.dest(pkginfo.dist));

return stream;
});

gulp.task('build:scripts', function() {
browserify({
entries: pkginfo.assets.scripts.entries,
Expand Down Expand Up @@ -48,3 +72,17 @@ gulp.task('clean', function(callback) {
glob = pkginfo.dist + '/*';
del([glob, '!.gitignore'], callback);
});



function getBowerPackageIds() {
// read bower.json and get dependencies' package ids
var bowerManifest = {};
try {
bowerManifest = require('./bower.json');
} catch (e) {
// does not have a bower.json manifest
}
return _.keys(bowerManifest.dependencies) || [];

}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
"reactify": "^1.1.1",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"browserify": "~11.0.0"
"browserify": "~11.0.0",
"bower-resolve": "~2.2.1",
"lodash": "~3.10.0"
},
"stylus": {
"includes": [
"./bower_components/bootstrap-stylus",
"./bower_components"
]
},
Expand Down
Loading

0 comments on commit 88b5861

Please sign in to comment.