Last active
August 29, 2015 14:03
-
-
Save handleman/ee059b9fbc14e9938bd1 to your computer and use it in GitHub Desktop.
Пример рабочего Gruntfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(grunt) { | |
| // Build a multi task "files" object dynamically. | |
| // Project configuration. | |
| grunt.initConfig({ | |
| pkg: grunt.file.readJSON('package.json'), | |
| concat: { | |
| js:{ | |
| src: [ | |
| 'frontend/www/js/jquery-ui.min.js', | |
| 'frontend/www/js/jquery-autocomplete.js', | |
| 'frontend/www/js/jQuery.Tree.js', | |
| 'frontend/www/js/jquery.jcarousel.min.js', | |
| 'frontend/www/js/jquery.livequery.min.js', | |
| 'frontend/www/js/jquery.placeholder.min.js', | |
| 'frontend/www/js/jquery.hoverscroll.js', | |
| 'frontend/www/js/jquery.fancybox-1.3.4.js', | |
| 'frontend/www/js/jquery.cookie.js', | |
| 'frontend/www/js/site-ui.js', | |
| 'frontend/www/js/matrix.js', | |
| 'frontend/www/js/rowSlider.js', | |
| 'frontend/www/js/fixedmenu.js', | |
| 'frontend/www/js/ajax-buttons.js', | |
| 'frontend/www/js/jquery.interface.js' | |
| ], | |
| dest: 'frontend/www/js/libs.js', | |
| }, | |
| css:{ | |
| src: [ | |
| 'frontend/www/css/reset.css', | |
| 'frontend/www/css/style.css', | |
| 'frontend/www/css/button.css', | |
| 'frontend/www/css/calendar.css', | |
| 'frontend/www/css/cusel.css', | |
| 'frontend/www/css/jquery.fancybox-1.3.4.css', | |
| 'frontend/www/css/jquery-autocomplete.css', | |
| 'frontend/www/css/jQuery.Tree.css', | |
| 'frontend/www/css/matrix.css', | |
| 'frontend/www/css/rowSlider.css', | |
| 'frontend/www/css/mailoverride.css', | |
| 'frontend/www/css/fixedmenuandthumbs.css', | |
| ], | |
| dest: 'frontend/www/css/libs.css', | |
| }, | |
| }, | |
| uglify: { | |
| all:{ | |
| files:{ | |
| 'frontend/www/js-min/libs.min.js': ['frontend/www/js/libs.js'] | |
| } | |
| }, | |
| mod:{ | |
| files: grunt.file.expandMapping(['frontend/www/js/_modules/*.js'], 'frontend/www/js-min/_modules/', { | |
| rename: function(destBase, destPath) { | |
| var filename = destPath.match(/.*\/(.*)$/)[1]; | |
| return destBase+filename.replace('.js', '.min.js'); | |
| } | |
| }) | |
| } | |
| }, | |
| cssmin: { | |
| all: { | |
| files: { | |
| 'frontend/www/css-min/libs.min.css': ['frontend/www/css/libs.css'] | |
| } | |
| }, | |
| main:{ | |
| files: { | |
| 'frontend/www/css-min/styles.min.css': ['frontend/www/css/styles.css'] | |
| } | |
| } | |
| }, | |
| watch: { | |
| options: { | |
| spawn: false, | |
| livereload: true, | |
| }, | |
| all: { | |
| files: ['frontend/www/js/*.js', 'frontend/www/css/*.css'], | |
| tasks: ['concat','uglify', 'cssmin'], | |
| options: { | |
| spawn: false, | |
| livereload: true, | |
| }, | |
| }, | |
| css: { | |
| files: ['frontend/www/css/*.css'], | |
| tasks: ['concat:css', 'cssmin'], | |
| options: { | |
| spawn: false, | |
| livereload: true, | |
| }, | |
| }, | |
| js: { | |
| files: ['frontend/www/js/*.js'], | |
| tasks: ['concat:js', 'uglify'], | |
| options: { | |
| spawn: false, | |
| livereload: true, | |
| }, | |
| }, | |
| } | |
| }); | |
| // Load the plugin that provides the "uglify" task. | |
| grunt.loadNpmTasks('grunt-newer'); | |
| grunt.loadNpmTasks('grunt-contrib-uglify'); | |
| grunt.loadNpmTasks('grunt-contrib-cssmin'); | |
| grunt.loadNpmTasks('grunt-contrib-concat'); | |
| // grunt.loadNpmTasks('grunt-contrib-less'); | |
| // grunt.loadNpmTasks('grunt-reload'); | |
| grunt.loadNpmTasks('grunt-contrib-watch'); | |
| // Default task(s). | |
| grunt.registerTask('default', ['watch:all']); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment