filebrowser/Gruntfile.js

82 lines
2.0 KiB
JavaScript
Raw Normal View History

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: {
files: ['assets/css/src/sass/**/*.scss'],
tasks: ['sass', 'concat', 'cssmin']
},
js: {
files: ['assets/js/src/**/*.js'],
tasks: ['uglify']
},
2015-09-16 19:18:12 +08:00
},
sass: {
dist: {
options: {
style: 'expanded',
sourcemap: 'none'
},
files: [{
expand: true,
2015-09-16 20:02:19 +08:00
cwd: 'assets/css/src/sass',
2015-09-16 19:18:12 +08:00
src: ['**/*.scss'],
2015-09-16 20:02:19 +08:00
dest: 'assets/css/src',
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-17 02:34:53 +08:00
'node_modules/animate.css/animate.min.css',
2015-09-16 20:58:36 +08:00
'assets/css/src/main.css'
2015-09-16 19:18:12 +08:00
],
2015-09-16 20:02:19 +08:00
dest: 'assets/css/src/main.css',
},
},
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: {
target: {
files: [{
expand: true,
2015-09-16 20:02:19 +08:00
cwd: 'assets/css/src',
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: {
target: {
files: {
2015-09-16 20:02:19 +08:00
'assets/js/app.min.js': ['node_modules/jquery/dist/jquery.js',
'node_modules/perfect-scrollbar/dist/js/perfect-scrollbar.jquery.js',
2015-09-16 19:18:12 +08:00
'node_modules/showdown/dist/showdown.js',
2015-09-16 21:19:35 +08:00
'node_modules/noty/js/noty/packaged/jquery.noty.packaged.js',
2015-09-16 20:58:36 +08:00
'assets/js/src/**/*.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-16 19:18:12 +08:00
};