-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8198377
commit 8baf4c2
Showing
21 changed files
with
39,926 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
node_modules | ||
bower_components | ||
bower_components | ||
source/app/**/*.js | ||
source/css/**/*.css |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
|
||
var gulp = require('gulp'); | ||
var path = require('path'); | ||
var ignore = require('gulp-ignore'); | ||
var less = require('gulp-less'); | ||
var typescript = require('gulp-typescript'); | ||
var inject = require('gulp-inject'); | ||
var mainBowerFiles = require('main-bower-files'); | ||
var browserSync = require('browser-sync'); | ||
var ngAnnotate = require('gulp-ng-annotate'); | ||
var sync = require('gulp-sync'); | ||
var del = require('del'); | ||
|
||
var config = { | ||
'site' : './source', | ||
'assets' : './source/assets', | ||
'app' : './source/app/', | ||
'injectFiles' : './source/index.html', | ||
'bowerComponents': './bower_components', | ||
|
||
'typescript' : { | ||
removeComments: false, | ||
target: 'ES5', | ||
noExternalResolve: false, | ||
noImplicitAny: false | ||
}, | ||
'typings' : './typings' | ||
} | ||
|
||
gulp.task('clean-app', function(cb) { | ||
del([ | ||
path.join(config.app, "**/*.css"), | ||
path.join(config.app, "**/*.map"), | ||
path.join(config.app, "**/*.js") | ||
], cb) | ||
}); | ||
|
||
gulp.task('clean-assets', function(cb) { | ||
del([path.join(config.assets,"**/*")], cb); | ||
}) | ||
|
||
gulp.task('copy-assets', ['clean-assets'], function() { | ||
return gulp.src(mainBowerFiles(),{ | ||
'base': config.bower_components | ||
}) | ||
.pipe(gulp.dest(config.assetsDir)); | ||
}); | ||
|
||
gulp.task('copy-assets', ['clean-assets'], function() { | ||
return gulp.src(mainBowerFiles(), { 'base': config.bowerComponents }) | ||
.pipe(gulp.dest(config.assets)); | ||
}); | ||
|
||
gulp.task('inject-files', function() { | ||
var assetsFiles = [ | ||
path.join(config.assets, "angular/*"), | ||
path.join(config.assets, "bootstrap/dist/css/bootstrap.css"), | ||
path.join(config.assets, "**/*"), | ||
]; | ||
|
||
var appFiles = [ | ||
path.join(config.app, "common/**/*"), | ||
path.join(config.app, "common/*"), | ||
path.join(config.app, "modules/**/*"), | ||
path.join(config.app, "*"), | ||
path.join(config.site, "css/*") | ||
]; | ||
|
||
var appStream = gulp.src(appFiles, { 'base' : config.site}); | ||
var assetsStream = gulp.src(assetsFiles, { 'base' : config.site}); | ||
|
||
return gulp.src(config.injectFiles) | ||
.pipe(inject(assetsStream, { name: 'assets', ignorePath: config.site.substring(2), relative:false})) | ||
.pipe(inject(appStream, { name: 'app', ignorePath: config.site.substring(2), relative:false})) | ||
.pipe(gulp.dest(config.site)); | ||
}); | ||
|
||
var tsProject = typescript.createProject(config.typescript); | ||
gulp.task('compile-ts', function() { | ||
|
||
var result = gulp.src([ | ||
path.join(config.app, "**/*.ts"), | ||
path.join(config.typings, "**/*.ts") | ||
]) | ||
.pipe(typescript(tsProject)); | ||
|
||
return result | ||
.pipe(ngAnnotate()) | ||
.pipe(gulp.dest(config.app)); | ||
}); | ||
|
||
gulp.task('compile-less', function() { | ||
return gulp.src(path.join(config.site, "**/*.less"), {base: config.site}) | ||
.pipe(less()) | ||
.pipe(gulp.dest(config.site)); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module MyApp { | ||
angular.module('MyApp', []); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module home { | ||
angular.module('home', []); | ||
} |
Oops, something went wrong.