This repository has been archived by the owner on Mar 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
118 lines (102 loc) · 3.32 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
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
module.exports = function(grunt) {
'use strict';
require('load-grunt-tasks')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
gruntfile: {
src: 'Gruntfile.js'
},
src: {
src: 'www/app/**/*.js'
}
},
sass: {
dev: {
files: {
'www/css/style.css': 'sass/style.scss'
}
},
prod: {
options: {
style: 'compressed'
},
files: {
'www/css/style.css': 'sass/style.scss'
}
}
},
watch: {
sass: {
files: ['sass/**/*.scss'],
tasks: ['sass:dev']
}
},
modernizr: {
dist: {
devFile: 'www/libs/modernizr/modernizr.js',
outputFile: 'www/libs/modernizr/modernizr-custom.js',
extra: {
load: false
},
tests: ['csstransforms'],
uglify: true,
files: {
src: [
'www/app/**/*',
'sass/**/*'
]
}
}
},
copy: {
build: {
files: [{
expand: true,
cwd: 'www/',
src: [
'*',
'app/templates/**/*',
'css/**',
'docs/**',
'img/**',
'!img/embedded-svgs/**/*',
'fonts/*',
'portfolio/**/*',
'libs/modernizr/modernizr-custom.js'
],
dest: 'build/'
}]
}
},
clean: {
build: 'build/'
},
requirejs: {
build: {
options: {
name: 'main',
mainConfigFile: 'www/app/main.js',
out: 'build/app/<%= pkg.version %>.js',
preserveLicenseComments: false,
almond: true,
replaceRequireScript: [{
files: ['build/index.html'],
module: '<%= pkg.version %>',
modulePath: './app/<%= pkg.version %>'
}]
}
}
},
'gh-pages': {
options: {
base: 'build',
branch: 'master',
repo: 'git@github.com:Rainbowlemon/rainbowlemon.github.io.git'
},
src: '**/*'
}
});
grunt.registerTask('build', ['clean:build', 'copy:build', 'requirejs:build']);
grunt.registerTask('default', ['modernizr', 'sass', 'jshint', 'clean:build', 'copy:build', 'requirejs:build', 'gh-pages', 'clean:build']);
};