diff options
author | Maximilian Hils <git@maximilianhils.com> | 2015-03-05 01:52:47 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2015-03-05 01:52:47 +0100 |
commit | 300868edff433f0f895a83482e0e7d92fa9e815e (patch) | |
tree | 6424bee76941f64997e0104ec48b1dbc1cc6a389 /web | |
parent | 4c95c68041a9647211c159939787eedd3ed542ed (diff) | |
download | mitmproxy-300868edff433f0f895a83482e0e7d92fa9e815e.tar.gz mitmproxy-300868edff433f0f895a83482e0e7d92fa9e815e.tar.bz2 mitmproxy-300868edff433f0f895a83482e0e7d92fa9e815e.zip |
clean up web builds
Diffstat (limited to 'web')
-rw-r--r-- | web/README | 4 | ||||
-rw-r--r-- | web/conf.js | 4 | ||||
-rw-r--r-- | web/gulpfile.js | 50 | ||||
-rw-r--r-- | web/package.json | 8 |
4 files changed, 29 insertions, 37 deletions
@@ -2,7 +2,5 @@ Starting up - npm install -- bower-installer - gulp - - +- run mitmweb and open http://localhost:8081/
\ No newline at end of file diff --git a/web/conf.js b/web/conf.js index 5106bae2..69984c01 100644 --- a/web/conf.js +++ b/web/conf.js @@ -6,7 +6,7 @@ var conf = { js: { // Don't package these in the vendor distribution vendor_excludes: [ - "bootstrap" + "bootstrap" // We only use Bootstrap's CSS. ], // Package these as well as the dependencies vendor_includes: [ @@ -27,7 +27,7 @@ var conf = { ], fonts: ["src/fontawesome/fontawesome-webfont.*"], peg: ["src/js/filt/filt.peg"], - port: 8082 + connect: false }; module.exports = conf;
\ No newline at end of file diff --git a/web/gulpfile.js b/web/gulpfile.js index b78090e4..04796761 100644 --- a/web/gulpfile.js +++ b/web/gulpfile.js @@ -1,35 +1,36 @@ -var gulp = require("gulp"); var path = require('path'); -var _ = require('lodash'); +var packagejs = require('./package.json'); +var conf = require('./conf.js'); + +// Sorted alphabetically! var browserify = require('browserify'); +var gulp = require("gulp"); var concat = require('gulp-concat'); var connect = require('gulp-connect'); -var buffer = require('vinyl-buffer'); var jshint = require("gulp-jshint"); var less = require("gulp-less"); var livereload = require("gulp-livereload"); -var map = require("map-stream"); var minifyCSS = require('gulp-minify-css'); var notify = require("gulp-notify"); +var peg = require("gulp-peg"); var plumber = require("gulp-plumber"); -var rev = require("gulp-rev"); var react = require("gulp-react"); -var reactify = require('reactify'); var rename = require("gulp-rename"); var replace = require('gulp-replace'); -var source = require('vinyl-source-stream'); +var rev = require("gulp-rev"); var sourcemaps = require('gulp-sourcemaps'); -var transform = require('vinyl-transform'); var uglify = require('gulp-uglify'); -var peg = require("gulp-peg"); -var filelog = require('gulp-filelog'); - -var packagejs = require('./package.json'); -var conf = require('./conf.js'); - +var _ = require('lodash'); +var map = require("map-stream"); +var reactify = require('reactify'); +var buffer = require('vinyl-buffer'); +var source = require('vinyl-source-stream'); +var transform = require('vinyl-transform'); // FIXME: react-with-addons.min.js for prod use issue +// FIXME: Sourcemap URLs don't work correctly. +// FIXME: Why don't we use gulp-rev's manifest feature? var manifest = { "vendor.css": "vendor.css", @@ -86,13 +87,11 @@ var dont_break_on_errors = function(){ ); }; - gulp.task("fonts", function () { return gulp.src(conf.fonts) - .pipe(gulp.dest(conf.dist + "fonts")); + .pipe(gulp.dest(conf.static + "/fonts")) }); - function styles_dev(files) { return (gulp.src(files) .pipe(dont_break_on_errors()) @@ -112,11 +111,11 @@ gulp.task("styles-vendor-dev", function(){ function styles_prod(files) { return (gulp.src(files) + .pipe(sourcemaps.init()) .pipe(less()) - // No sourcemaps support yet :-/ - // https://github.com/jonathanepollack/gulp-minify-css/issues/34 .pipe(minifyCSS()) .pipe(rev()) + .pipe(sourcemaps.write(".", {sourceRoot: "/static"})) .pipe(save_rev()) .pipe(gulp.dest(conf.static)) .pipe(livereload({ auto: false }))); @@ -185,7 +184,6 @@ gulp.task("jshint", function () { return gulp.src(conf.js.jshint) .pipe(dont_break_on_errors()) .pipe(react()) - .pipe(plumber()) .pipe(jshint()) .pipe(jshint.reporter("jshint-stylish")) .pipe(jsHintErrorReporter()); @@ -193,7 +191,7 @@ gulp.task("jshint", function () { gulp.task("copy", function(){ return gulp.src(conf.copy, {base:"src/"}) - .pipe(gulp.dest(conf.dist)); + .pipe(gulp.dest(conf.static)); }); function templates(){ @@ -209,14 +207,15 @@ gulp.task("peg", function () { return gulp.src(conf.peg, {base: "src/"}) .pipe(dont_break_on_errors()) .pipe(peg()) - .pipe(filelog()) .pipe(gulp.dest("src/")); }); gulp.task('connect', function() { - connect.server({ - port: conf.port - }); + if(conf.connect){ + connect.server({ + port: conf.connect.port + }); + } }); gulp.task( @@ -242,7 +241,6 @@ gulp.task( "scripts-vendor-prod", "peg", "scripts-app-prod", - "connect" ], templates ); diff --git a/web/package.json b/web/package.json index 2afae777..7dce1993 100644 --- a/web/package.json +++ b/web/package.json @@ -23,7 +23,6 @@ "flux": "" }, "devDependencies": { - "bower": "", "browserify": "=8.0.1", "gulp": "", "gulp-concat": "", @@ -33,6 +32,7 @@ "gulp-livereload": "", "gulp-minify-css": "", "gulp-notify": "", + "gulp-peg": "", "gulp-plumber": "", "gulp-react": "", "gulp-rename": "", @@ -40,17 +40,13 @@ "gulp-rev": "", "gulp-sourcemaps": "", "gulp-uglify": "", - "gulp-util": "", "jest-cli": "^0.1.18", "jshint-stylish": "", "lodash": "", "map-stream": "", - "react": "", - "react-tools": "", "reactify": "", "vinyl-buffer": "", "vinyl-source-stream": "", - "vinyl-transform": "", - "gulp-peg": "" + "vinyl-transform": "" } } |