Skip to content

Commit

Permalink
finished
Browse files Browse the repository at this point in the history
  • Loading branch information
n.lyubchich committed Jul 31, 2015
1 parent 0b2eb3f commit df015c1
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 65 deletions.
31 changes: 0 additions & 31 deletions bower.json

This file was deleted.

21 changes: 8 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ var stylus = require('gulp-stylus');
var uglify = require('gulp-uglify');
var _ = require('lodash');
var fs = require('vinyl-fs');
var bowerResolve = require('bower-resolve');

var debug = gutil.env.type === 'production';
var bowerPackages = _.keys(require('./bower.json').dependencies) || [];
var debug = gutil.env.type !== 'production';

var npmPackages = _.keys(require('./package.json').dependencies) || [];

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

Expand All @@ -32,10 +32,8 @@ gulp.task('build:scripts:app', function (done) {
debug: debug,
entries: [file]
});
bowerPackages.forEach(function (lib) {
var resolvedPath = bowerResolve.fastReadSync(lib);
console.log(resolvedPath);
b.external(resolvedPath)
npmPackages.forEach(function (id) {
b.external(id);
});

return b
Expand All @@ -45,7 +43,7 @@ gulp.task('build:scripts:app', function (done) {
extname: ".bundle.js"
}))
.pipe(buffer())
.pipe(debug ? uglify() : gutil.noop())
.pipe(debug ? gutil.noop() : uglify() )
.pipe(gulp.dest(pkginfo.dist));
});
es.merge(tasks).on('end', done);
Expand All @@ -56,11 +54,8 @@ gulp.task('build:scripts:vendor', function () {
var b = browserify({
debug: debug
});
bowerPackages.forEach(function (id) {
var resolvedPath = bowerResolve.fastReadSync(id);
b.require(resolvedPath, {
expose: id
});
npmPackages.forEach(function (id) {
b.require(id)
});
return b.bundle()
.pipe(source('vendor.js'))
Expand Down
42 changes: 23 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,21 @@
},
"homepage": "https://github.com/uaprom-summer-2015/Meowth#readme",
"dependencies": {
"bower": "^1.4.1",
"debowerify": "^1.3.1",
"del": "^1.2.0",
"gulp": "^3.9.0",
"gulp-rename": "^1.2.2",
"gulp-stylus": "^2.0.5",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.6",
"reactify": "^1.1.1",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"browserify": "~11.0.0",
"bower-resolve": "~2.2.1",
"lodash": "~3.10.0",
"glob": "~5.0.14",
"event-stream": "~3.3.1",
"vinyl-fs": "~1.0.0"
"bootstrap": "~3.3.5",
"bootstrap-select": "~1.7.3",
"jquery": "~2.1.4",
"react": "~0.13.3",
"react-mini-router": "~1.1.7",
"react-select": "~0.5.5"
},
"stylus": {
"includes": [
"./bower_components"
"./node_modules"
]
},
"browserify": {
"transform": [
"debowerify",
"reactify"
],
"extensions": [
Expand Down Expand Up @@ -75,5 +64,20 @@
]
}
},
"dist": "./project/static/dist"
"dist": "./project/static/dist",
"devDependencies": {
"gulp": "~3.9.0",
"del": "^1.2.0",
"gulp-rename": "^1.2.2",
"gulp-stylus": "^2.0.5",
"gulp-uglify": "^1.2.0",
"gulp-util": "^3.0.6",
"reactify": "^1.1.1",
"glob": "~5.0.14",
"event-stream": "~3.3.1",
"vinyl-fs": "~1.0.0",
"vinyl-buffer": "^1.0.0",
"vinyl-source-stream": "^1.1.0",
"browserify": "~11.0.0"
}
}
4 changes: 2 additions & 2 deletions project/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta charset="UTF-8"><script src="{{ url_for('static', filename="dist/vendor.js") }}" type="text/javascript"></script>

{% block meta %}{% endblock%}
<link rel="stylesheet" href="{{ url_for('static', filename='dist/bundle.css') }}">
<script src="{{ url_for('static', filename="dist/vendor.js") }}" type="text/javascript"></script>
<title>{% block title %}{% endblock %}</title>
</head>
<body>
Expand Down

0 comments on commit df015c1

Please sign in to comment.