-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathGruntfile.js
71 lines (68 loc) · 2.1 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
module.exports = function(grunt) {
/* Project configurations */
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
cssmin: {
plugin: {
files: [
{
expand: true,
cwd: '<%= pkg.name %>',
src: ['*.css', '!*.min.css'],
dest: '<%= pkg.name %>',
ext: '.min.css'
},
{
expand: true,
cwd: '<%= pkg.name %>/static/css',
src: ['*.css', '!*.min.css'],
dest: '<%= pkg.name %>/static/css',
ext: '.min.css'
}
]
}
},
uglify: {
plugin: {
files: [
{
expand: true,
cwd: '<%= pkg.name %>/static/js',
src: ['*.js', '!*.min.js'],
dest: '<%= pkg.name %>/static/js',
ext: '.min.js'
}
]
}
},
version: {
project: {
src: ['composer.json']
},
plugin: {
options: {
prefix: 'Version:\\s+'
},
src: ['<%= pkg.name %>/<%= pkg.name %>.php']
},
loader: {
options: {
prefix: 'const VERSION\\s+=\\s+[\'"]'
},
src: ['<%= pkg.name %>/src/Loader.php']
},
readme: {
options: {
prefix: 'Stable tag:\\s+'
},
src: ['<%= pkg.name %>/readme.txt']
}
}
});
/* Load plugins */
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-version');
/* Create default task */
grunt.registerTask('default', ['cssmin', 'uglify']);
};