This repository has been archived by the owner on Jun 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathGruntfile.js
129 lines (122 loc) · 3.68 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
119
120
121
122
123
124
125
126
127
128
129
module.exports = function (grunt) {
/**
* Load required Grunt tasks. These are installed based on the versions listed
* in `package.json` when you do `npm install` in this directory.
*/
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-autoprefixer');
/**
* This is the configuration object Grunt uses to give each plugin its
* instructions.
*/
grunt.initConfig({
/**
* We read in our `package.json` file so we can access the package name and
* version. It's already there, so we don't repeat ourselves here.
*/
pkg: grunt.file.readJSON("package.json"),
/**
* The banner is the comment that is placed at the top of our compiled
* source files. It is first processed as a Grunt template, where the `<%=`
* pairs are evaluated based on this very configuration object.
*/
usebanner: {
dist: {
options: {
banner: '/**\n' +
' * <%= pkg.name %> - v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>\n' +
' * <%= pkg.homepage %>\n' +
' *\n' +
' * Copyright (c) <%= grunt.template.today("yyyy") %>\n' +
' * Authors : Gabriele Genta & Martin Mouterde\n' +
' * Licensed <%= pkg.licenses.type %> <<%= pkg.licenses.url %>>\n' +
' */'
},
files: {
src: [ 'dist/**']
}
}
},
autoprefixer: {
dist: {
src: 'dist/angular-layout.css',
dest: 'dist/angular-layout.css'
}
},
/**
* The directories to delete when `grunt clean` is executed.
*/
clean: [
'dist/'
],
copy: {
dist: {
files: [
{
src: [ 'src/js/angular-layout.js' ],
dest: 'dist/angular-layout.js'
}
]
}
},
/**
* Minify the sources!
*/
uglify: {
dist: {
files: {
'dist/angular-layout.min.js': 'src/js/angular-layout.js'
}
}
},
cssmin: {
dist: {
files: [
{
expand: true,
cwd: 'dist',
src: ['*.css'],
dest: 'dist',
ext: '.min.css'
}
]
}
},
less: {
dev: {
files: [
{
expand: true,
cwd: 'src/less',
src: ['*.less'],
dest: 'dist',
ext: '.css'
}
]
}
}
});
/**
* The default task is to build and compile.
*/
grunt.registerTask('default', [
'build'
]);
/**
* The `build` task gets your app ready to run for development and testing.
*/
grunt.registerTask('build', [
'clean',
'copy',
'uglify',
'less',
'autoprefixer',
'cssmin',
'usebanner'
]);
};