diff --git a/gulp/build.js b/gulp/build.js index 9326d6be..4346a6de 100644 --- a/gulp/build.js +++ b/gulp/build.js @@ -26,7 +26,7 @@ var gulp = require('gulp'), imagemin = require('gulp-imagemin'), minifyHtml = require('gulp-minify-html'), bowerFiles = require('main-bower-files'), - replace = require('gulp-replace-task'); + replace = require('gulp-replace'); gulp.task('default', ['clean'], function () { @@ -227,5 +227,15 @@ gulp.task('build:images', function () { .pipe(size()); }); +gulp.task('package:strip', function () { + return gulp.src(['lemur/static/dist/scripts/main*']) + .pipe(replace('http:\/\/localhost:5000', '')) + .pipe(replace('http:\/\/localhost:3000', '')) + .pipe(useref()) + .pipe(revReplace()) + .pipe(gulp.dest('lemur/static/dist/scripts')) + .pipe(size()); +}); gulp.task('build', ['build:ngviews', 'build:inject', 'build:images', 'build:fonts', 'build:html', 'build:extras']); +gulp.task('package', ['package:strip']); diff --git a/lemur/static/app/angular/app.js b/lemur/static/app/angular/app.js index af4957f9..3ed03188 100644 --- a/lemur/static/app/angular/app.js +++ b/lemur/static/app/angular/app.js @@ -62,7 +62,7 @@ lemur.controller('datePickerController', function ($scope, $timeout){ lemur.factory('LemurRestangular', function (Restangular, $location, $auth) { return Restangular.withConfig(function (RestangularConfigurer) { - RestangularConfigurer.setBaseUrl('http://127.0.0.1:5000/api/1'); + RestangularConfigurer.setBaseUrl('http://localhost:5000/api/1'); RestangularConfigurer.setDefaultHttpFields({withCredentials: true}); RestangularConfigurer.addResponseInterceptor(function (data, operation, what, url, response, deferred) { diff --git a/package.json b/package.json index ee027237..b66140e1 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "gulp-plumber": "^0.6.4", "gulp-print": "^1.1.0", "gulp-protractor": "0.0.11", - "gulp-replace": "~0.4.0", + "gulp-replace": "~0.5.3", "gulp-replace-task": "~0.1.0", "gulp-rev": "^1.0.0", "gulp-rev-replace": "^0.3.0", diff --git a/setup.py b/setup.py index 93803b95..3685cb62 100644 --- a/setup.py +++ b/setup.py @@ -81,6 +81,8 @@ class BuildStatic(Command): log.info("running [gulp buld]") check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'build'], cwd=ROOT) + log.info("running [gulp package]") + check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'package'], cwd=ROOT) setup( name='lemur',