forked from mhalle/oabrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
139 lines (132 loc) · 4.66 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
const gulp = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const babel = require('gulp-babel');
const concat = require('gulp-concat');
const uglify = require('gulp-uglify');
const clean = require('gulp-clean');
const templateCache = require('gulp-angular-templatecache');
const filesList = [
"bower_components/jquery/dist/jquery.js",
"libs/jquery.mousewheel.js",
"libs/limit.js",
"libs/inobounce.js",
"libs/uri.js",
"bower_components/angular/angular.js",
"bower_components/angular-sanitize/angular-sanitize.js",
"bower_components/bootstrap/dist/js/bootstrap.js",
"bower_components/angular-animate/angular-animate.min.js",
"libs/ui-bootstrap-tpls-1.3.1.min.js",
"bower_components/adapt-strap/dist/adapt-strap.min.js",
"bower_components/adapt-strap/dist/adapt-strap.tpl.min.js",
"libs/ui-layout.js",
"libs/rzslicer.js",
"libs/ng-tags/ng-tags-input.min.js",
"libs/firebase.js",
"libs/angularfire.min.js",
"libs/moment-with-locales.min.js",
"babel/angularInit.js",
"tmp/templates.js",
"babel/mainAppProvider.js",
"babel/atlasJsonProvider.js",
"babel/objectSelectorProvider.js",
"babel/volumesManagerProvider.js",
"babel/loadingManagerProvider.js",
"babel/crosshairProvider.js",
"babel/screenshotSceneProvider.js",
"babel/undoRedoManagerService.js",
"babel/firebaseViewService.js",
"babel/toArrayFilter.js",
"babel/compileDirective.js",
"babel/insertTreeDirective.js",
"babel/insertBreadcrumbs.js",
"babel/insertSliceDirective.js",
"babel/bookmarksDirective.js",
"babel/messagesDirective.js",
"babel/mainToolbarDirective.js",
"babel/sceneCrosshairDirective.js",
"babel/confirmationModalDirective.js",
"babel/layoutController.js",
"babel/modalController.js",
"babel/headerController.js",
"babel/loginModalController.js",
"libs/three.min.js",
"libs/TrackballControls.js",
"babel/Volume.js",
"babel/VolumeSlice.js",
"babel/MultiVolumesSlice.js",
"babel/NRRDLoader.js",
"babel/VTKLoader.js",
"libs/MTLLoader.js",
"libs/OBJLoader.js",
"libs/Detector.js",
"libs/stats.min.js",
"libs/zlib_and_gzip.min.js",
"libs/dat.gui.min.js",
"babel//LightKit.js",
"libs/Tween.js",
"babel/hierarchyGroup.js",
"babel/app.js"
];
const babelFiles = [
"angularInit.js",
"ng-providers/mainAppProvider.js",
"ng-providers/atlasJsonProvider.js",
"ng-providers/objectSelectorProvider.js",
"ng-providers/volumesManagerProvider.js",
"ng-providers/loadingManagerProvider.js",
"ng-providers/crosshairProvider.js",
"ng-providers/screenshotSceneProvider.js",
"ng-providers/undoRedoManagerService.js",
"ng-providers/firebaseViewService.js",
"ng-filters/toArrayFilter.js",
"ng-directives/compileDirective.js",
"ng-directives/insertTreeDirective.js",
"ng-directives/insertBreadcrumbs.js",
"ng-directives/insertSliceDirective.js",
"ng-directives/bookmarksDirective.js",
"ng-directives/messagesDirective.js",
"ng-directives/mainToolbarDirective.js",
"ng-directives/sceneCrosshairDirective.js",
"ng-directives/confirmationModalDirective.js",
"ng-controllers/layoutController.js",
"ng-controllers/modalController.js",
"ng-controllers/headerController.js",
"ng-controllers/loginModalController.js",
"libs/Volume.js",
"libs/VolumeSlice.js",
"libs/MultiVolumesSlice.js",
"libs/NRRDLoader.js",
"libs/VTKLoader.js",
"libs/LightKit.js",
"hierarchyGroup.js",
"app.js"
];
gulp.task('babel', () => {
return gulp.src(babelFiles)
.pipe(babel({
presets: ['es2015']
}))
.pipe(gulp.dest('babel'));
});
gulp.task('templates', function () {
return gulp.src('ng-templates/**/*.html')
.pipe(templateCache('templates.js', {
root : 'ng-templates',
module : 'atlasDemo'
}))
.pipe(gulp.dest('tmp'));
});
gulp.task('build', ['babel', 'templates'], () => {
return gulp.src(filesList)
.pipe(sourcemaps.init())
.pipe(concat('all.js'))
.pipe(uglify())
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest('dist'));
});
gulp.task('clean', ['babel', 'templates', 'build'], function () {
return gulp.src(['babel','tmp'], {read: false})
.pipe(clean());
});
gulp.task('default', ['babel', 'templates', 'build', 'clean'],function () {
});