Skip to content

Commit

Permalink
Improving grunt tasks, fixing indentation, removing redundancies
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrasser committed Dec 23, 2013
1 parent e7e218d commit 42babe7
Show file tree
Hide file tree
Showing 9 changed files with 673 additions and 675 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
Thumbs.DB
node_modules
bower_components
build/*
demo/dist/*
1 change: 1 addition & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"unused": true,
"strict": false,
"node": true,
"browser": true,
"jquery": true,
"globals": {
"prettyPrint": false,
Expand Down
49 changes: 39 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,28 @@ module.exports = function (grunt) {

// Concat definitions
concat: {
dist: {
jquery: {
files: {
"dist/jquery.linkify.js": [
"build/jquery.linkify.js": [
"src/linkified.js",
"src/jquery.linkify.js"
]
}
},
options: {
banner: "<%= meta.banner %>"
}
},

// Wrap files
wrap: {
jquery: {
expand: true,
src: ['build/jquery.linkify.js'],
dest: 'build/',
options: {
wrapper: [
'<%= meta.banner %>\n;(function ($, window, document, undefined) {\n"use strict";',
'})(jQuery, window, document)\n'
]
}
}
},

Expand All @@ -44,7 +56,7 @@ module.exports = function (grunt) {

// Minify definitions
uglify: {
my_target: {
dist: {
src: ["dist/jquery.linkify.js"],
dest: "dist/jquery.linkify.min.js"
},
Expand All @@ -54,7 +66,13 @@ module.exports = function (grunt) {
},

copy: {
main: {
build: {
expand: true,
flatten: true,
src: "build/build/*",
dest: "dist/"
},
demo: {
src: "dist/*",
dest: "demo/"
},
Expand Down Expand Up @@ -93,21 +111,32 @@ module.exports = function (grunt) {
},

clean: [
".grunt/grunt-gh-pages/gh-pages"
".grunt/grunt-gh-pages/gh-pages",
"build/*"
]

});

grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-contrib-concat");
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-uglify");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-wrap");
grunt.loadNpmTasks("grunt-gh-pages");
grunt.loadNpmTasks("grunt-bumper");

grunt.registerTask("default", ["jshint", "concat", "uglify", "copy"]);
grunt.registerTask("default", [
"jshint",
"concat",
"wrap",
"copy:build",
"uglify",
"copy:demo",
"clean"
]);

grunt.registerTask("travis", ["jshint"]);
grunt.registerTask("release", ["bumper", "clean"]);
grunt.registerTask("release:minor", ["bumper:minor", "clean"]);
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"license": "MIT",
"dependencies": {
"jquery": ">= 1.9.0"
"jquery": "~1.10.2"
},
"ignore": [
"**/.*",
Expand Down
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ <h3 id="options">Options</h3>
<script src="../bower_components/jquery/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/prettify/r298/prettify.js"></script>
<script src="dist/jquery.linkify.js"></script>
<script src="dist/jquery.linkify.min.js"></script>
<script src="js/main.js"></script>

</body>
Expand Down
Loading

0 comments on commit 42babe7

Please sign in to comment.