-
Notifications
You must be signed in to change notification settings - Fork 0
/
gruntfile.js
37 lines (33 loc) · 1.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
module.exports = function (grunt) {
grunt.initConfig({
// define source files and their destinations
uglify: {
files: {
src: 'js/app/**/*.js', // source files mask
dest: 'js/jsm/', // destination folder
expand: true, // allow dynamic building
flatten: true, // remove all unnecessary nesting
ext: '.min.js' // replace .js to .min.js
}
},
cssmin: {
files: {
cwd: 'css/',
src: ['*.css', '!*.min.css'], // source files mask
dest: 'css/', // destination folder
expand: true, // allow dynamic building
ext: '.min.css' // replace .css to .min.css
}
},
watch: {
js: { files: 'js/app/**/*.js', tasks: [ 'uglify' ] },
css: { files: ['css/*.css', 'css/!*.min.css'], tasks: [ 'cssmin' ] }
}
});
// load plugins
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
// register tasks
grunt.registerTask('default', [ 'uglify', 'cssmin' ]);
};