Skip to content

Commit

Permalink
Add Bower clean
Browse files Browse the repository at this point in the history
Reduces Setup file by 7 mb -- removes unnecessary bower downloads
  • Loading branch information
Some Popcorn Time Contributor authored and sammuel86 committed Aug 24, 2014
1 parent 204ed32 commit bfaba8d
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 15 deletions.
16 changes: 12 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,20 @@ module.exports = function(grunt) {
var currentVersion = pkgJson.version;

require('load-grunt-tasks')(grunt);
grunt.loadNpmTasks('grunt-bower-clean');

grunt.registerTask('default', [
'stylus',
'jshint',
'bower_clean',
'injectgit'
]);

grunt.registerTask('css', [
'stylus'
]);


grunt.registerTask('build', [
'css',
'injectgit',
Expand All @@ -53,6 +56,8 @@ module.exports = function(grunt) {
'compress' // win & linux
]);



grunt.registerTask('start', function() {
var start = parseBuildPlatforms();
if (start.win) {
Expand All @@ -69,13 +74,16 @@ module.exports = function(grunt) {
});

grunt.registerTask('injectgit', function() {
if(grunt.file.exists('.git/')) {
if (grunt.file.exists('.git/')) {
var path = require('path');
var gitRef = grunt.file.read('.git/HEAD').split(':')[1].trim();
var gitBranch = path.basename(gitRef);
if(grunt.file.exists('.git/' + gitRef)) {
if (grunt.file.exists('.git/' + gitRef)) {
var currCommit = grunt.file.read('.git/' + gitRef).trim();
var git = {branch: gitBranch, commit: currCommit};
var git = {
branch: gitBranch,
commit: currCommit
};
grunt.file.write('.git.json', JSON.stringify(git, null, ' '));
}
}
Expand Down Expand Up @@ -212,4 +220,4 @@ module.exports = function(grunt) {

});

};
};
33 changes: 23 additions & 10 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
{
"name": "popcorn-time",
"dependencies": {
"marionette": "~1.8.3",
"bootstrap": "~3.1.1",
"videojs": "4.6.1",
"videojs-youtube": "1.1.0",
"mousetrap": "~1.4.6",
"font-awesome": "~4.1.0"
}
}
"name": "popcorn-time",
"dependencies": {
"marionette": "~1.8.3",
"bootstrap": "~3.1.1",
"videojs": "4.6.1",
"videojs-youtube": "1.1.0",
"mousetrap": "~1.4.6",
"font-awesome": "~4.1.0"
},
"dependenciesIgnore": {
"backbone": ["**/!(backbone.js)"],
"jquery": ["**/!(dist)"],
"font-awesome": ["less", "scss", ".*"],
"videojs": ["**/!(dist)"],
"videojs-youtube": ["**/!(src)"],
"underscore": ["**/!(underscore.js)"],
"mousetrap": ["tests", ".gitignore", "./*!mousetrap.min.js"],
"marionette": ["**/!(lib)"],
"backbone.babysitter": ["**/!(lib)"],
"backbone.wreqr": ["**/!(lib)"],
"bootstrap": ["**/!(dist)"]
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@
"nw-gyp": "^0.12.2",
"stylus": "0.46.2"
}
}
}

0 comments on commit bfaba8d

Please sign in to comment.