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 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
| module.exports = function (grunt) { 'use strict'; grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), less: { development: { options: { paths: \["./"\] }, files: \[{ expand: true, cwd: './public/dev/less', src: \['\*\*/g.less'\], dest: 'public/dev/less', ext: '.css' }\] } }, cssmin: { target: { files: \[{ expand: true, cwd: './public/dev/less', src: \['\*.css', '!\*.min.css'\], dest: 'public/css', ext: '.min.css' }\] } }, concat: { options: { stripBanners: true, banner: '/\* <%=pkg.name%>-<%=pkg.verson%>.js <%=grunt.template.today("yyyy-mm-dd")%> \*/' }, es6: { src:\[ '/libs/es5-shim/4.5.7/es5-shim.min.js', '/libs/es5-shim/4.5.7/es5-sham.min.js', '/libs/json3/3.3.2/json3.min.js', '/libs/es6-shim/0.34.2/es6-shim.min.js', '/libs/es6-shim/0.34.2/es6-sham.min.js', '/libs/axios/0.16.0/axios.min.js' \], dest:'./public/dev/js/es5~es6.js' }, plugins: { src: \['b.js', 'c.js'\], dest: 'all-sec.js', } }, uglify: { options: { stripBanners: true, banner: '/\* <%=pkg.name%> <%=grunt.template.today("yyyy-mm-dd")%> by Yitong.com \*/' }, buildall: { options:{ mangle:false, preserveComments: 'some', footer:'' }, files: \[{ expand: true, src: 'usercenter/\*.js', ext:'.js', dest: 'dev/js' }\] }, build: { files: { './public/dev/js/cc.js': \['/libs/axios/0.16.0/axios.min.js'\] } } }, jshint: { build: \['Gruntfils.js', './public/js/usercenter/\*.js'\], options: { jshintrc: '.jshintrc' } }, watch: { options: { livereload: true, spawn: false }, build: { files: \['./public/dev/less/\*.less'\], tasks: \['less','cssmin'\] } }, }); grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-contrib-cssmin'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); grunt.registerTask('default', \['less', 'concat', 'uglify','watch'\]); };
|