-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
72 lines (63 loc) · 1.83 KB
/
gulpfile.js
File metadata and controls
72 lines (63 loc) · 1.83 KB
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
var gulp = require('gulp'),
watch = require('gulp-watch'),
nodemon = require('gulp-nodemon'),
bundle_script = require('./gulp-tasks/bundle-script'),
bundle_style = require('./gulp-tasks/bundle-style'),
script_compress = require('./gulp-tasks/script-compress'),
config = {
public_path: 'public/',
assets_path: 'public/assets/',
scripts_start_point: 'public/coffee/app.js',
server_start_point: 'app.coffee',
server_scripts_sources: 'protected/*.js',
scripts_sources: 'public/coffee/**/*.js',
styles_sources: 'public/sass/**/*.scss',
bundle_script_name: '~.js',
bundle_style_name: '~.css',
bundle_min_script_name: '~.min.js',
bundle_min_style_name: '~.min.css'
};
gulp.task('bundle-script', bundle_script({
bundle_name: config.bundle_script_name,
src: config.scripts_start_point,
dest: config.assets_path
}));
gulp.task('compress-script', script_compress({
filename: config.bundle_min_script_name,
src: config.assets_path + config.bundle_script_name,
dest: config.assets_path
}));
gulp.task('bundle-style', bundle_style({
src: config.styles_sources,
dest: config.assets_path,
config: {
//outputStyle: 'compressed'
}
}));
gulp.task('build', function() {
gulp.run([
'bundle-script',
'compress-script',
'bundle-style'
]);
});
gulp.task('public-files-watch', function() {
gulp.watch(config.scripts_sources, [
'bundle-script',
'compress-script'
]);
gulp.watch(config.styles_sources, [
'bundle-style'
]);
});
gulp.task('nodemon', function() {
nodemon({
script: config.server_start_point,
watch: config.server_scripts_sources,
ext: 'js'
});
});
gulp.task('default', [
'public-files-watch',
'nodemon'
]);