-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
47 lines (42 loc) · 1.62 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
/**
* Created by enricoaleandri on 19/11/16.
*/
var gulp = require('gulp');
var inject = require('gulp-inject');
var angularFilesort = require('gulp-angular-filesort');
var bowerFiles = require('main-bower-files');
var util = require('gulp-util');
gulp.task('inject', function () {
var target = gulp.src('./views/partials/header.ejs');
// It's not necessary to read the files (will speed up things), we're only after their paths:
return target
.pipe(inject(gulp.src(bowerFiles(), {read: false}), {
name: 'bower',
addRootSlash : false,
//ignorePath : 'src/main/webapp',
transform : function ( filePath, file, i, length ) {
var newPath = filePath.replace( 'public/', '' );
return inject.transform.apply(inject.transform, [ newPath, file, i, length]);
}
}))
.pipe(inject(
gulp.src(['./public/app/**/*.js']).pipe(angularFilesort()),{
addRootSlash : false,
//ignorePath : 'src/main/webapp',
transform : function ( filePath, file, i, length ) {
var newPath = filePath.replace( 'public/', '' );
return inject.transform.apply(inject.transform, [ newPath, file, i, length]);
}
}))
.pipe(inject(
gulp.src(['./public/stylesheets/**/*.css']),{
addRootSlash : false,
//ignorePath : 'src/main/webapp',
transform : function ( filePath, file, i, length ) {
var newPath = filePath.replace( 'public/', '' );
return inject.transform.apply(inject.transform, [ newPath, file, i, length]);
}
}))
.pipe(gulp.dest('./views/partials/'));
});
gulp.task('build', ['inject']);