-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
90 lines (85 loc) · 2.87 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
js: {
src: ['js/global/jquery-3.2.1.min.js', 'js/global/tether.min.js', 'js/global/bootstrap.min.js', 'js/global/plugins/*.js', 'js/global/contact.js', 'js/*.js'],
dest: '../dist/js/app.js',
},
css: {
src: ['css/global/*.css', 'css/global/plugins/*.css', 'css/*.css'],
dest: '../dist/css/app.css',
},
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= pkg.author %> <%= pkg.license %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: '../dist/js/app.js',
dest: '../dist/js/app.min.js'
}
},
cssmin: {
css: {
src: '../dist/css/app.css',
dest: '../dist/css/app.min.css'
}
},
processhtml: {
dist: {
files: [{
expand: true, // Enable dynamic expansion.
cwd: './', // Src matches are relative to this path.
src: ['*.html'], // Actual pattern(s) to match.
dest: '../dist/', // Destination path prefix.
}],
}
},
copy: {
main: {
files: [
// includes files within path
{
expand: true,
src: ['fonts/*', 'images/**', 'php/**'],
dest: '../dist/',
filter: 'isFile'
}
],
},
},
rcs: {
css: {
options: {
replaceCss: true
},
files: [{
expand: true,
cwd: './',
src: 'css/**/*.css',
dest: '../dist',
}]
},
all: {
files: [{
expand: true,
cwd: './',
src: ['js/**/*.js', '*.html'],
dest: '../dist',
}]
}
},
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-processhtml');
grunt.loadNpmTasks('grunt-contrib-copy');
// grunt.loadNpmTasks('grunt-rcs');
// Default task(s).
//grunt.registerTask('default', ['uglify', 'rcs:css', 'rcs:all']);
grunt.registerTask('build', ['concat', 'uglify', 'cssmin', 'processhtml', 'copy']);
};