Skip to content

Commit

Permalink
Update build process + Add dist folder to contain compiled source.
Browse files Browse the repository at this point in the history
  • Loading branch information
Himanshu Kapoor committed Aug 10, 2014
1 parent a8e9911 commit f963a39
Show file tree
Hide file tree
Showing 8 changed files with 3,673 additions and 10 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ vwoapp/*
.idea/*
docs/*
test/unit-tests.js
test/dom-comparator.js
testem.json
node_modules
bower_components
35 changes: 31 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
module.exports = function (grunt) {
'use strict';

var licenseBanner = '/*!' + '\n' +
'The MIT License (MIT)' + '\n' +
'http://opensource.org/licenses/MIT' + '\n\n' +
'Copyright (c) 2014 Wingify Software Pvt. Ltd.' + '\n' +
'http://wingify.com' + '\n' +
'*/\n\n' +
'var VWO = window.VWO || {}; \n';

var fs = require('fs');
var execSync = require('exec-sync');

Expand All @@ -16,10 +24,14 @@ module.exports = function (grunt) {
},
concat: {
options: {
separator: '\n'
separator: '\n',
process: function (src) {
return licenseBanner + '(function(){\n' +
src + '\n})();';
}
},
domComparator: {
dest: 'test/dom-comparator.js',
dest: 'dist/dom-comparator.js',
src: ['src/*.js']
},
unit: {
Expand All @@ -40,14 +52,29 @@ module.exports = function (grunt) {
spawn: false, // don't spawn another process
livereload: true // runs livereload server on 35729
}
}
},
uglify: {
options: {
mangle: false,
wrap: 'closure',
banner: licenseBanner,
sourceMap: true,
sourceMapIncludeSources: true
},
domComparator: {
files: {
'dist/dom-comparator.min.js': 'src/*.js'
}
}
},
});

grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.registerTask('testem', function () {
var testemConfig = {
Expand All @@ -64,5 +91,5 @@ module.exports = function (grunt) {
}
});

grunt.registerTask('default', ['concat', 'testem']);
grunt.registerTask('default', ['concat', 'uglify']);
};
Loading

0 comments on commit f963a39

Please sign in to comment.