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-sass');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-cssmin');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
|
|
|
|
|
|
grunt.initConfig({
|
|
|
|
watch: {
|
2015-09-16 20:58:36 +08:00
|
|
|
sass: {
|
2015-09-19 21:25:35 +08:00
|
|
|
files: ['assets/src/sass/**/*.scss'],
|
2015-09-16 20:58:36 +08:00
|
|
|
tasks: ['sass', 'concat', 'cssmin']
|
|
|
|
},
|
|
|
|
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
|
|
|
},
|
|
|
|
sass: {
|
|
|
|
dist: {
|
|
|
|
options: {
|
|
|
|
style: 'expanded',
|
|
|
|
sourcemap: 'none'
|
|
|
|
},
|
|
|
|
files: [{
|
|
|
|
expand: true,
|
2015-09-19 21:25:35 +08:00
|
|
|
cwd: 'assets/src/sass',
|
2015-09-16 19:18:12 +08:00
|
|
|
src: ['**/*.scss'],
|
2015-09-19 21:25:35 +08:00
|
|
|
dest: 'temp/css',
|
2015-09-16 19:18:12 +08:00
|
|
|
ext: '.css'
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
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',
|
|
|
|
'node_modules/animate.css/source/fading_exits/fadeOut.css',
|
2015-09-18 16:47:02 +08:00
|
|
|
'node_modules/codemirror/lib/codemirror.css',
|
2015-09-29 04:11:52 +08:00
|
|
|
'node_modules/codemirror/theme/ttcn.css',
|
2015-09-19 21:25:35 +08:00
|
|
|
'temp/css/**/*.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-18 16:47:02 +08:00
|
|
|
'node_modules/codemirror/lib/codemirror.js',
|
2015-09-19 21:47:59 +08:00
|
|
|
'node_modules/codemirror/mode/css/css.js',
|
|
|
|
'node_modules/codemirror/mode/javascript/javascript.js',
|
|
|
|
'node_modules/codemirror/mode/markdown/markdown.js',
|
|
|
|
'node_modules/codemirror/mode/sass/sass.js',
|
2015-09-26 18:42:00 +08:00
|
|
|
'node_modules/codemirror/mode/htmlmixed/htmlmixed.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
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-09-16 20:02:19 +08:00
|
|
|
grunt.registerTask('default', ['copy', 'sass', 'concat', 'cssmin', 'uglify']);
|
2015-09-29 04:11:52 +08:00
|
|
|
};
|