Skip to content

Commit 66df47f

Browse files
author
Joshua Baert
committed
Merge branch 'master' into Josh-Db
2 parents 0d99b64 + 7c6bb2e commit 66df47f

17 files changed

Lines changed: 131 additions & 0 deletions

File tree

gulpfile.js

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
2+
//1. Make gulpfile
3+
//2. npm i all dependencies
4+
//3. check all folder paths used in gulpfile
5+
//4. Update index.html
6+
//5. Run gulp watch
7+
8+
var gulp = require('gulp'),
9+
del = require('del'),
10+
sass = require('gulp-sass'),
11+
sourcemaps = require('gulp-sourcemaps'),
12+
uglify = require('gulp-uglify'),
13+
concat = require('gulp-concat'),
14+
print = require('gulp-print'),
15+
babel = require('gulp-babel');
16+
//babel-preset-es2015
17+
18+
19+
var CacheBuster = require('gulp-cachebust');
20+
var cachebust = new CacheBuster();
21+
22+
const paths = {
23+
jsSource: ['./src/components/**/*.js', './src/components/*.js'],
24+
cssFiles: './src/assets/scss/*.scss',
25+
index: './src/index.html',
26+
htmlFiles: './src/**/*.html',
27+
dist: './dist',
28+
};
29+
30+
gulp.task('build-css', function(){
31+
return gulp.src(paths.cssFiles)
32+
.pipe(sourcemaps.init())
33+
.pipe(sass())
34+
.pipe(cachebust.resources())
35+
.pipe(concat('styles.css'))
36+
.pipe(gulp.dest(paths.dist));
37+
});
38+
39+
gulp.task('clean', function (cb) {
40+
del([
41+
'dist'
42+
], cb);
43+
});
44+
45+
gulp.task('build-html', function(){
46+
return gulp.src([paths.htmlFiles, paths.index])
47+
.pipe(gulp.dest(paths.dist))
48+
});
49+
50+
gulp.task('build-js', function() {
51+
return gulp.src(paths.jsSource)
52+
.pipe(sourcemaps.init())
53+
.pipe(print())
54+
.pipe(babel({ presets: ['es2015'] }))
55+
.pipe(concat('bundle.js'))
56+
// .pipe(uglify())
57+
.pipe(sourcemaps.write('./'))
58+
.pipe(gulp.dest(paths.dist));
59+
});
60+
61+
gulp.task('watch', function() {
62+
return gulp.watch([paths.jsSource, paths.cssFiles, paths.index, paths.htmlFiles],['clean', 'build-css', 'build-js', 'build-html']);
63+
});
64+
65+
gulp.task('default', ['clean', 'build-css', 'build-js', 'build-html', 'watch']);

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,17 @@
2020
"dependencies": {
2121
"body-parser": "^1.15.2",
2222
"cors": "^2.8.1",
23+
"del": "^2.2.2",
2324
"express": "^4.14.0",
2425
"express-session": "^1.14.2",
26+
"gulp": "^3.9.1",
27+
"gulp-babel": "^6.1.2",
28+
"gulp-cachebust": "0.0.6",
29+
"gulp-concat": "^2.6.1",
30+
"gulp-print": "^2.0.1",
31+
"gulp-sass": "^3.0.0",
32+
"gulp-sourcemaps": "^1.9.1",
33+
"gulp-uglify": "^2.0.0",
2534
"massive": "^2.5.0"
2635
}
2736
}

src/assets/scss/styles.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
background-color: red;
3+
}

src/components/app.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
angular.module('app', ['ui.router'])
2+
3+
4+
.config(function($stateProvider, $urlRouterProvider){
5+
$stateProvider
6+
.state('home',{
7+
url: '/',
8+
templateUrl:'./home/home.html',
9+
controller: 'homeCtrl'
10+
})
11+
.state('kata_list',{
12+
url: '/kata_list',
13+
templateUrl:'./kata_list/kata_list.html',
14+
controller: 'kata_listCtrl'
15+
})
16+
.state('login',{
17+
url: '/login',
18+
templateUrl:'./login/login.html',
19+
controller: 'loginCtrl'
20+
})
21+
.state('profile',{
22+
url: '/profile',
23+
templateUrl:'./profile/profile.html',
24+
controller: 'profileCtrl'
25+
})
26+
.state('solutions',{
27+
url: '/solutions',
28+
templateUrl:'./solutions/solutions.html',
29+
controller: 'solutionsCtrl'
30+
})
31+
.state('training',{
32+
url: '/training',
33+
templateUrl:'./training/training.html',
34+
controller: 'trainingCtrl'
35+
});
36+
37+
$urlRouterProvider.otherwise('/');
38+
});
39+

src/components/home/homeCtrl.js

Whitespace-only changes.

src/components/kata_list/kata_list.html

Whitespace-only changes.

src/components/kata_list/kata_listCtrl.js

Whitespace-only changes.

src/components/login/login.html

Whitespace-only changes.

src/components/login/loginCtrl.js

Whitespace-only changes.

0 commit comments

Comments
 (0)