-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
executable file
·103 lines (94 loc) · 3.05 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
project: {
root: './src/main/webapp',
public: '<%= project.root %>/public',
app: '<%= project.root %>/app',
scss: [
'<%= project.public %>/scss/main.scss'
],
js: [
'<%= project.public %>/scripts/*.js',
'<%= project.app %>/**/*.js'
]
},
karma: {
unit: {
configFile: './src/main/webapp/test/karma.client.config.js',
plugins:[
'karma-jasmine',
'karma-coverage',
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-phantomjs-launcher'
]
}
},
sass : {
dev: {
options: {
style: 'expanded',
compass: false,
sourcemap: 'none',
},
files: {
'<%= project.public %>/styles/main.css': '<%= project.scss %>'
}
},
dist: {
options: {
style: 'compressed',
compass: false,
sourcemap: 'none',
},
files: {
'<%= project.public %>/styles/main.css': '<%= project.scss %>'
}
}
},
watch: {
sass: {
files: '<%= project.public %>/scss/{,*/}*.{scss,sass}',
tasks: ['sass:dev']
}
},
concat: {
dist: {
src: [
'<%= project.public %>/scripts/*.js', // All public scripts
'<%= project.app %>/**/*.js' // All the app scripts
],
dest: '<%= project.public %>/build/production.js'
}
},
uglify: {
build: {
src: '<%= project.public %>/build/production.js',
dest: '<%= project.public %>/build/production.min.js'
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: {
src: [
'<%= project.app %>/**/*.js' // All the app scripts
]
}
}
});
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
//grunt.loadNpmTasks('grunt-contrib-sass');
//grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-sass');
grunt.registerTask('default', ['sass:dist']);
grunt.registerTask('test', ['jshint', 'karma']);
//grunt.registerTask('build', ['sass:dev', 'karma']);
//grunt.registerTask('pre-deploy', ['sass:dist', 'concat', 'uglify']);
grunt.registerTask('build', ['sass:dist']);
};