forked from DavidCramer/uix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
112 lines (108 loc) · 3.75 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
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg : grunt.file.readJSON( '../package.json' ),
namespace : grunt.option( "slug" ),
curl: {
'../assets/js/handlebars.min-latest.js' : 'http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars.min-latest.js'
},
copy: {
main: {
files:[
{
expand: false,
cwd: './',
src: 'uix-bootstrap.php',
dest: '../<%= pkg.namespace %>-bootstrap.php'
},
{
expand: false,
cwd: './',
src: 'uix-plugin.php',
dest: '../<%= pkg.namespace %>-plugin.php'
},
{
expand: true,
cwd: 'includes',
src: '**',
dest: '../includes/'
},
{
expand: true,
cwd: 'assets/css',
src: '**',
dest: '../assets/css/'
},
{
expand: true,
cwd: 'assets/js',
src: '**',
dest: '../assets/js/'
},
{
expand: true,
cwd: 'assets/svg',
src: '**',
dest: '../assets/svg/'
},
{
expand: true,
cwd: 'assets/controls',
src: '**',
dest: '../assets/controls/'
},
{
expand: true,
cwd: 'classes/uix/',
src: '**',
dest: '../classes/<%= pkg.namespace %>/'
}
]
}
},
rename: {
core: {
src: '../classes/<%= pkg.namespace %>/ui/uix.php',
dest: '../classes/<%= pkg.namespace %>/ui/<%= pkg.namespace %>.php'
}
},
uglify: {
min: {
files: grunt.file.expandMapping( [
'assets/js/*.js',
'!assets/js/*.min.js',
'!assets/js/*.min-latest.js'
], '../assets/js/', {
rename : function ( destBase, destPath ) {
return destBase + destPath.replace( '.js', '.min.js' );
},
flatten: true
} )
}
},
cssmin: {
options: {
keepSpecialComments: 0
},
minify : {
expand: true,
cwd : '../assets/css/',
src : ['*.css', '!*.min.css'],
dest : '../assets/css/',
ext : '.min.css'
}
},
clean: {
build: ["etc/**", "node_modules/**",".git/**",".gitignore","composer.json","Gruntfile.js","package.json"],
},
});
//load modules
grunt.loadNpmTasks( 'grunt-curl' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.loadNpmTasks( 'grunt-rename' );
//installer tasks
grunt.registerTask( 'default', [ 'curl', 'copy', 'rename', 'cssmin', 'uglify', 'clean' ] );
};