Skip to content

Commit

Permalink
Updated admin gulp to use ng-html2js & moved directory structure into…
Browse files Browse the repository at this point in the history
… lib folder. See 4
  • Loading branch information
MKHenson committed Apr 1, 2016
1 parent 99db01f commit 9b68b15
Show file tree
Hide file tree
Showing 31 changed files with 31 additions and 6 deletions.
27 changes: 24 additions & 3 deletions admin/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ var request = require('request');
var untar = require('gulp-untar');
var source = require('vinyl-source-stream');
var filter = require('gulp-filter');
var ngHtml2Js = require("gulp-ng-html2js");
var minifyHtml = require("gulp-minify-html");
var uglify = require("gulp-uglify");

// CONFIG
// ==============================
Expand Down Expand Up @@ -56,9 +59,9 @@ gulp.task('ts-code', function() {
/**
* Copies the html source to its output directory
*/
gulp.task('copy-html', function() {
gulp.task('copy-bootstrap', function() {

return gulp.src("html/**", { base: "html" })
return gulp.src("lib/bootstrap/**", { base: "lib/bootstrap" })
.pipe(gulp.dest(outDir));

});
Expand Down Expand Up @@ -146,6 +149,24 @@ gulp.task('deploy-third-party', function() {
.pipe(gulp.dest(outDir + "/third-party"));
});

/**
* Builds the definition
*/
gulp.task('html-to-ng', function() {
gulp.src("./lib/**/*.html")
.pipe(minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe(ngHtml2Js({
moduleName: "admin-templates",
prefix: ""
}))
.pipe(concat("partials.min.js"))
.pipe(uglify())
.pipe(gulp.dest(outDir + "/templates"));
});

/**
* Builds the definition
Expand Down Expand Up @@ -175,4 +196,4 @@ gulp.task('ts-code-declaration', function() {
.pipe(gulp.dest(outDirDefinitions));
});

gulp.task('build-all', [ 'deploy-third-party', 'copy-html', 'ts-code', 'ts-code-declaration']);
gulp.task('build-all', [ 'copy-bootstrap', 'deploy-third-party', 'html-to-ng', 'ts-code', 'ts-code-declaration']);
2 changes: 1 addition & 1 deletion admin/lib/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module clientAdmin
{
'use strict';

var appModule = angular.module("admin", ["ui.router", "ngAnimate", "ngSanitize", 'angular-loading-bar', 'ngFileUpload'])
var appModule = angular.module("admin", ["ui.router", "ngAnimate", "ngSanitize", 'angular-loading-bar', 'ngFileUpload', 'admin-templates'])
.constant("usersURL", _users )
.constant("mediaURL", _media )
.constant("apiURL", "./api")
Expand Down
1 change: 1 addition & 0 deletions admin/html/index.jade → admin/lib/bootstrap/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ html(lang="en")
script(type="text/javascript", src=url + "/third-party/tinymce/tinymce.js")
each plugin, index in plugins
script(type="text/javascript", src=url + plugin)
script(type="text/javascript", src=url + "/templates/partials.min.js")
script(type="text/javascript", src=url + "/main.js")
base(href="/")

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 5 additions & 2 deletions admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
"vinyl-source-stream": "^1.1.0",
"gulp-untar": "^0.0.4",
"gulp-util": "^3.0.7",
"gulp-filter" : "^4.0.0"
"gulp-filter" : "^4.0.0",
"gulp-ng-html2js": "^0.2.2",
"gulp-minify-html": "^1.0.6",
"gulp-uglify": "^1.5.3"
}
}
}

0 comments on commit 9b68b15

Please sign in to comment.