|
1 | 1 | module.exports = function(grunt) {
|
2 | 2 |
|
3 |
| - grunt.initConfig({ |
4 |
| - pkg: grunt.file.readJSON('package.json'), |
5 |
| - |
6 |
| - uglify: { |
7 |
| - options: { |
8 |
| - report: 'gzip', |
9 |
| - banner: '/*! Selectric ϟ v<%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>) - git.io/tjl9sQ - Copyright (c) <%= grunt.template.today("yyyy") %> Leonardo Santos - Dual licensed: MIT/GPL */\n' |
10 |
| - }, |
11 |
| - build: { |
12 |
| - src: 'js/jquery.selectric.js', |
13 |
| - dest: 'js/jquery.selectric.min.js' |
14 |
| - } |
15 |
| - } |
16 |
| - }); |
17 |
| - |
18 |
| - grunt.loadNpmTasks('grunt-contrib-uglify'); |
19 |
| - |
20 |
| - grunt.registerTask('default', ['uglify']); |
| 3 | + grunt.initConfig({ |
| 4 | + pkg: grunt.file.readJSON('package.json'), |
| 5 | + |
| 6 | + copy: { |
| 7 | + main: { |
| 8 | + files: [{ |
| 9 | + expand: true, |
| 10 | + src: ['jquery.selectric.js'], |
| 11 | + dest: 'dist/', |
| 12 | + filter: 'isFile' |
| 13 | + }] |
| 14 | + } |
| 15 | + }, |
| 16 | + |
| 17 | + usebanner: { |
| 18 | + dist: { |
| 19 | + options: { |
| 20 | + position: 'top', |
| 21 | + banner: '\/*!\r\n * ,\/\r\n * ,\'\/\r\n * ,\' \/\r\n * ,\' \/_____,\r\n * .\'____ ,\'\r\n * \/ ,\'\r\n * \/ ,\'\r\n * \/,\'\r\n * \/\'\r\n *\r\n * Selectric \u03DE v<%= pkg.version %> - http:\/\/lcdsantos.github.io\/jQuery-Selectric\/\r\n *\r\n * Copyright (c) <%= grunt.template.today("yyyy") %> Leonardo Santos; Dual licensed: MIT\/GPL\r\n *\r\n *\/\n', |
| 22 | + linebreak: true |
| 23 | + }, |
| 24 | + files: { |
| 25 | + src: 'dist/jquery.selectric.js' |
| 26 | + } |
| 27 | + } |
| 28 | + }, |
| 29 | + |
| 30 | + uglify: { |
| 31 | + build: { |
| 32 | + options: { |
| 33 | + report: 'gzip', |
| 34 | + banner: '/*! Selectric ϟ v<%= pkg.version %> (<%= grunt.template.today("yyyy-mm-dd") %>) - git.io/tjl9sQ - Copyright (c) <%= grunt.template.today("yyyy") %> Leonardo Santos - Dual licensed: MIT/GPL */\n' |
| 35 | + }, |
| 36 | + files: { |
| 37 | + 'dist/jquery.selectric.min.js': ['jquery.selectric.js'] |
| 38 | + } |
| 39 | + } |
| 40 | + }, |
| 41 | + |
| 42 | + jquerymanifest: { |
| 43 | + options: { |
| 44 | + source: grunt.file.readJSON('package.json'), |
| 45 | + overrides: { |
| 46 | + name: "selectric", |
| 47 | + title: "jQuery Selectric", |
| 48 | + author: { |
| 49 | + name: "Leonardo Santos", |
| 50 | + email: "leocs.1991@gmail.com" |
| 51 | + }, |
| 52 | + keywords: [ "select", "selectbox", "dropdown", "form", "input", "ui" ], |
| 53 | + description: "Fast, simple and light jQuery plugin to customize HTML selects", |
| 54 | + licenses: [ |
| 55 | + { |
| 56 | + type: "MIT", |
| 57 | + url: "http://opensource.org/licenses/MIT" |
| 58 | + }, |
| 59 | + { |
| 60 | + type: "GPL-3.0", |
| 61 | + url: "http://opensource.org/licenses/GPL-3.0" |
| 62 | + } |
| 63 | + ], |
| 64 | + bugs: "https://github.com/lcdsantos/jQuery-Selectric/issues", |
| 65 | + homepage: "http://lcdsantos.github.io/jQuery-Selectric/", |
| 66 | + docs: "http://lcdsantos.github.io/jQuery-Selectric/", |
| 67 | + demo: "http://lcdsantos.github.io/jQuery-Selectric/demo.html", |
| 68 | + dependencies: { |
| 69 | + "jquery": ">=1.7" |
| 70 | + } |
| 71 | + } |
| 72 | + } |
| 73 | + }, |
| 74 | + |
| 75 | + sass: { |
| 76 | + dist: { |
| 77 | + options: { |
| 78 | + outputStyle: 'compressed' |
| 79 | + }, |
| 80 | + files: { |
| 81 | + 'dist/selectric.css': 'selectric.scss' |
| 82 | + } |
| 83 | + } |
| 84 | + }, |
| 85 | + |
| 86 | + cssbeautifier: { |
| 87 | + options : { |
| 88 | + indent: ' ' |
| 89 | + }, |
| 90 | + files : ['dist/selectric.css'] |
| 91 | + } |
| 92 | + }); |
| 93 | + |
| 94 | + // Javascript |
| 95 | + grunt.loadNpmTasks('grunt-contrib-copy'); |
| 96 | + grunt.loadNpmTasks('grunt-banner'); |
| 97 | + grunt.loadNpmTasks('grunt-contrib-uglify'); |
| 98 | + grunt.loadNpmTasks('grunt-jquerymanifest'); |
| 99 | + |
| 100 | + // CSS |
| 101 | + grunt.loadNpmTasks('grunt-sass'); |
| 102 | + grunt.loadNpmTasks('grunt-cssbeautifier'); |
| 103 | + |
| 104 | + grunt.registerTask('default', ['copy', 'usebanner', 'uglify', 'sass', 'cssbeautifier', 'jquerymanifest']); |
21 | 105 |
|
22 | 106 | };
|
0 commit comments