-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
83 lines (80 loc) · 1.88 KB
/
Gruntfile.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
'use strict';
module.exports = function(grunt) {
grunt.initConfig({
compass: {
dist: {
options: {
basePath: 'src/',
config: 'src/config.rb',
cssDir: 'css',
environment: 'production'
}
}
},
copy: {
main: {
files: [
{expand: true, cwd: 'src/img/', src: ['**'], dest: 'production/img/'},
{expand: true, cwd: 'src/css/', src: ['screen.css'], dest: 'production/css/'},
{expand: true, cwd: 'src/js/', src: ['**'], dest: 'production/js/'}
]
},
css: {
files: [
{expand: true, cwd: 'src/img/', src: ['**'], dest: 'production/img/'},
{expand: true, cwd: 'src/css/', src: ['**'], dest: 'production/css/'},
]
},
js: {
files: [
{expand: true, cwd: 'src/js/', src: ['**'], dest: 'production/js/'}
]
}
},
includereplace: {
dist: {
options: {
prefix: '@@',
suffix: ''
},
src: 'src/*.html',
dest: 'production/'
}
},
csso: {
dist: {
src: 'src/css/screen.css',
dest:'production/css/screen.min.css'
}
},
watch: {
css: {
files: 'src/sass/*.scss',
tasks: ['compass','copy:css','clean:css'],
},
js: {
files: 'src/js/*.js',
tasks: ['copy:js'],
},
html: {
files: 'src/*html',
tasks: ['includereplace', 'clean:html'],
},
},
clean: {
html: ["production/_*.html"],
css: ["production/css/lib", "src/css"],
dev: ["production/_*.html", "production/css/lib", "src/css"],
release: ["production"],
after: ["production/_*.html", "src/css", "production/img/icons"]
}
});
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-include-replace');
grunt.loadNpmTasks('grunt-csso');
grunt.registerTask( 'default', ['watch']);
grunt.registerTask( 'release', ['clean:release', 'compass', 'copy:main', 'includereplace', 'csso', 'clean:after']);
};