Skip to content
Browse files

Add grunt build script

  • Loading branch information...
1 parent 4391adb commit fa30ff8364af4e94a2bf791d31efeda82483366e @sindresorhus sindresorhus committed
Showing with 87 additions and 20 deletions.
  1. +60 −0 grunt.js
  2. +25 −0 package.json
  3. +2 −20 src/crapLoader.js
View
60 grunt.js
@@ -0,0 +1,60 @@
+module.exports = function( grunt ) {
+ 'use strict';
+
+ grunt.initConfig({
+ pkg: '<json:package.json>',
+ meta: {
+ banner: '/*!\n' +
+ '* <%= pkg.name %>\n' +
+ '* v<%= pkg.version %> - ' +
+ '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
+ '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
+ '* (c) <%= pkg.author.name %>\n' +
+ '* MIT License\n' +
+ '*/'
+ },
+ concat: {
+ dist: {
+ src: ['<banner:meta.banner>', 'src/<%= pkg.name %>.js'],
+ dest: 'dist/<%= pkg.name %>.js'
+ }
+ },
+ min: {
+ dist: {
+ src: ['<banner:meta.banner>', 'src/<%= pkg.name %>.js'],
+ dest: 'dist/<%= pkg.name %>.min.js'
+ }
+ },
+ lint: {
+ files: ['grunt.js', 'src/<%= pkg.name %>.js']
+ },
+ watch: {
+ files: '<config:lint.files>',
+ tasks: 'default'
+ },
+ jshint: {
+ options: {
+ es5: true,
+ esnext: true,
+ bitwise: true,
+ curly: true,
+ eqeqeq: true,
+ newcap: true,
+ noarg: true,
+ noempty: true,
+ regexp: true,
+ undef: true,
+ strict: true,
+ trailing: true,
+ smarttabs: true,
+ browser: true,
+ nonstandard: true,
+ expr: true
+ }
+ }
+ });
+
+ grunt.registerTask('default', 'lint');
+ grunt.registerTask('release', 'concat min');
+
+};
View
25 package.json
@@ -0,0 +1,25 @@
+{
+ "name": "crapLoader",
+ "version": "0.1.0",
+ "description": "Asynchronous script loader for ads, widgets and other third-party content",
+ "keywords": [
+ "script",
+ "loader",
+ "async"
+ ],
+ "homepage": "https://github.com/gregersrygg/crapLoader",
+ "bugs": "https://github.com/gregersrygg/crapLoader/issues",
+ "author": {
+ "name": "Gregers Rygg"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/gregersrygg/crapLoader.git"
+ },
+ "devDependencies": {
+ "grunt": "~0.3.9"
+ },
+ "licenses": [{
+ "type": "MIT"
+ }]
+}
View
22 src/crapLoader.js
@@ -1,23 +1,5 @@
-/**
- * Copyright (c) 2011 Gregers Rygg
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
- * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
- * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
- * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- */
-/*jslint browser: true, evil: true*/
-/*globals console*/
-
+/*jshint browser:true, evil:true */
+/*globals console */
var crapLoader = (function() {
var isHijacked = false,
queue = [],

0 comments on commit fa30ff8

Please sign in to comment.
Something went wrong with that request. Please try again.