Permalink
Browse files

adding dependencis and Gruntfile

  • Loading branch information...
1 parent 8b38ff1 commit 934120a20bf4e0df1c29c173033e42aa1a2e0b01 @pajtai committed Feb 24, 2013
Showing with 71 additions and 3 deletions.
  1. +66 −0 Gruntfile.js
  2. +5 −3 tasks/useref.js
View
@@ -0,0 +1,66 @@
+/*global module:false */
+// The line above is used for jshint plugins in your IDE
+
+/**
+ * This file is used when running npm test
+ * @param grunt
+ */
+module.exports = function (grunt) {
+ 'use strict';
+
+ var project = {
+
+ dirs: {
+ input : 'test/input',
+ output : 'test/output',
+ temp : 'temp'
+ },
+
+ files: {
+ scripts : '/scripts',
+ vendor : '/scripts/vendor',
+ any : '/**/*',
+ thisDir : '/*',
+ dot : {
+ javascript : '.js',
+ html : '.html'
+ }
+ }
+ },
+
+ gruntConfig = {
+
+ // allow grunt tasks easy access to the project object
+ project: project,
+
+ pkg: grunt.file.readJSON('package.json'),
+
+ // Copy things to a temp dir, and only change things in the temp dir
+ copy: {
+ test: {
+ files: [
+ {expand: true, cwd: 'test/input/', src : ['**'], dest: 'test/output/' }
+ ]
+ }
+ },
+
+ // Useref will got through all html files in output
+ useref: {
+
+ html: project.dirs.output + project.files.any + project.files.dot.html,
+
+ temp: project.dirs.output
+
+ }
+
+ };
+
+ grunt.initConfig(gruntConfig);
+
+ grunt.loadNpmTasks('grunt-bump');
+ grunt.loadNpmTasks('grunt-contrib-copy');
+
+ grunt.loadTasks('./tasks/');
+
+ grunt.registerTask('test', ['copy', 'useref', 'concat', 'uglify', 'cssmin']);
+};
View
@@ -6,9 +6,11 @@
module.exports = function (grunt) {
'use strict';
- grunt.loadNpmTasks('grunt-contrib-concat');
- grunt.loadNpmTasks('grunt-contrib-uglify');
- grunt.loadNpmTasks('grunt-css');
+
+ grunt.loadNpmTasks('grunt-useref/node_modules/grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-useref/node_modules/grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-useref/node_modules/grunt-css');
+
// TODO: check that `temp` is defined before proceeding

0 comments on commit 934120a

Please sign in to comment.