2015-09-16 19:18:12 +08:00
|
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-copy');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-concat');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
|
|
|
|
grunt.initConfig({
|
|
|
|
watch: {
|
2015-09-16 20:58:36 +08:00
|
|
|
sass: {
|
2016-02-01 06:14:17 +08:00
|
|
|
files: ['assets/src/css/**/*.css'],
|
|
|
|
tasks: ['concat', 'cssmin']
|
2015-09-16 20:58:36 +08:00
|
|
|
},
|
|
|
|
js: {
|
2015-09-19 21:25:35 +08:00
|
|
|
files: ['assets/src/js/**/*.js'],
|
|
|
|
tasks: ['uglify:main']
|
2015-09-16 20:58:36 +08:00
|
|
|
},
|
2015-09-16 19:18:12 +08:00
|
|
|
},
|
|
|
|
concat: {
|
|
|
|
css: {
|
|
|
|
src: ['node_modules/normalize.css/normalize.css',
|
|
|
|
'node_modules/font-awesome/css/font-awesome.css',
|
2015-09-23 02:37:01 +08:00
|
|
|
'node_modules/animate.css/source/_base.css',
|
|
|
|
'node_modules/animate.css/source/bouncing_entrances/bounceInRight.css',
|
2016-02-08 05:12:01 +08:00
|
|
|
'node_modules/animate.css/source/fading_entrances/fadeIn.css',
|
2015-09-23 02:37:01 +08:00
|
|
|
'node_modules/animate.css/source/fading_exits/fadeOut.css',
|
2016-02-01 06:14:17 +08:00
|
|
|
'assets/src/css/main.css'
|
2015-09-16 19:18:12 +08:00
|
|
|
],
|
2015-09-19 21:25:35 +08:00
|
|
|
dest: 'temp/css/main.css',
|
2015-09-16 20:02:19 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
copy: {
|
|
|
|
main: {
|
|
|
|
files: [{
|
|
|
|
expand: true,
|
|
|
|
flatten: true,
|
|
|
|
src: ['node_modules/font-awesome/fonts/**'],
|
|
|
|
dest: 'assets/fonts'
|
|
|
|
}],
|
2015-09-16 19:18:12 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
cssmin: {
|
2015-09-26 18:42:00 +08:00
|
|
|
options: {
|
2015-09-21 05:45:08 +08:00
|
|
|
keepSpecialComments: 0
|
2015-09-26 18:42:00 +08:00
|
|
|
},
|
2015-09-16 19:18:12 +08:00
|
|
|
target: {
|
|
|
|
files: [{
|
|
|
|
expand: true,
|
2015-09-19 21:25:35 +08:00
|
|
|
cwd: 'temp/css/',
|
2015-09-16 19:18:12 +08:00
|
|
|
src: ['*.css', '!*.min.css'],
|
2015-09-16 20:02:19 +08:00
|
|
|
dest: 'assets/css/',
|
2015-09-16 19:18:12 +08:00
|
|
|
ext: '.min.css'
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
uglify: {
|
2015-09-19 21:25:35 +08:00
|
|
|
plugins: {
|
2015-09-16 19:18:12 +08:00
|
|
|
files: {
|
2015-09-19 21:25:35 +08:00
|
|
|
'assets/js/plugins.min.js': ['node_modules/jquery/dist/jquery.min.js',
|
2015-09-17 18:32:27 +08:00
|
|
|
'node_modules/perfect-scrollbar/dist/js/min/perfect-scrollbar.jquery.min.js',
|
|
|
|
'node_modules/showdown/dist/showdown.min.js',
|
|
|
|
'node_modules/noty/js/noty/packaged/jquery.noty.packaged.min.js',
|
2015-09-17 04:48:08 +08:00
|
|
|
'node_modules/jquery-pjax/jquery.pjax.js',
|
2015-09-17 18:32:27 +08:00
|
|
|
'node_modules/jquery-serializejson/jquery.serializejson.min.js',
|
2015-09-16 19:18:12 +08:00
|
|
|
]
|
|
|
|
}
|
2015-09-19 21:25:35 +08:00
|
|
|
},
|
|
|
|
main: {
|
|
|
|
files: {
|
|
|
|
'assets/js/app.min.js': ['assets/src/js/**/*.js']
|
|
|
|
}
|
2015-09-16 19:18:12 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-02-05 06:30:46 +08:00
|
|
|
grunt.registerTask('default', ['copy', 'concat', 'cssmin', 'uglify']);
|
2016-02-01 06:14:17 +08:00
|
|
|
};
|