Skip to content

Commit

Permalink
chore(grunt): fix issue #153 (grunt server build time)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Lamping committed Apr 17, 2014
1 parent fa3a808 commit 94397e9
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 29 deletions.
4 changes: 0 additions & 4 deletions grunt-tasks/after-test.js

This file was deleted.

3 changes: 0 additions & 3 deletions grunt-tasks/before-test.js

This file was deleted.

9 changes: 5 additions & 4 deletions grunt-tasks/build.js
Expand Up @@ -132,15 +132,16 @@ module.exports = function (grunt) {
var srcFiles = _.pluck(modules, 'srcFiles');
var tplJsFiles = _.pluck(modules, 'tplJsFiles');

//Set the concat task to concatenate the given src modules
// Set the concat task to concatenate the given src modules
grunt.config('concat.dist.src', grunt.config('concat.dist.src').concat(srcFiles));

//Set the concat-with-templates task to concat the given src & tpl modules
// Set the concat-with-templates task to concat the given src & tpl modules
grunt.config('concat.distTpls.src', grunt.config('concat.distTpls.src').concat(srcFiles).concat(tplJsFiles));

//Set the copy task to process via grunt template
// Set the copy task to process via grunt template
grunt.config('copy.demohtml.options.process', grunt.template.process);

grunt.task.run(['clean:build', 'less:encore', 'concat']);
grunt.task.run(['clean:build', 'concat:dist', 'concat:distTpls', 'less',
'copy:demohtml', 'copy:demoassets', 'copy:componentImages']);
});
};
3 changes: 2 additions & 1 deletion grunt-tasks/default.js
@@ -1,3 +1,4 @@
module.exports = function(grunt) {
grunt.registerTask('default', ['before-test', 'test', 'after-test']);
grunt.registerTask('default', ['clean', 'syntax-check', 'html2js',
'build', 'test', 'minify', 'copy', 'rxPageObjects', 'ngdocs']);
};
3 changes: 3 additions & 0 deletions grunt-tasks/minify.js
@@ -0,0 +1,3 @@
module.exports = function (grunt) {
grunt.registerTask('minify', ['cssmin', 'ngmin', 'uglify']);
};
2 changes: 1 addition & 1 deletion grunt-tasks/options/connect.js
Expand Up @@ -29,7 +29,7 @@ module.exports = {
config.mountFolder(cnct, config.docs)
];
},
livereload:1337
livereload: 1337
}
},
keepalive: {
Expand Down
14 changes: 7 additions & 7 deletions grunt-tasks/options/watch.js
Expand Up @@ -4,25 +4,25 @@ module.exports = {
},
scripts: {
files: ['src/**/*.js', '!src/*/*.spec.js'],
tasks: ['jshint:scripts', 'jscs', 'karma:watch:run', 'after-test']
tasks: ['build', 'karma:watch:run']
},
specs: {
files: ['src/**/*.spec.js'],
tasks: ['jshint:specs', 'karma:watch:run', 'copy:coverage'],
tasks: ['karma:watch:run', 'copy:coverage'],
options: {
livereload: false
}
},
componentHtml: {
files: ['src/**/templates/*.html'],
tasks: ['after-test', 'karma:watch:run']
tasks: ['html2js', 'build', 'karma:watch:run']
},
css: {
componentLess: {
files: ['src/**/*.less'],
tasks: ['less']
},
html: {
files: ['demo/*', 'src/**/docs/*.html', 'src/**/*.md'],
tasks: ['html2js', 'build', 'copy']
demoSite: {
files: ['src/**/docs/*.html', 'src/**/*.md', 'demo/*'],
tasks: ['build']
}
};
10 changes: 6 additions & 4 deletions grunt-tasks/server.js
Expand Up @@ -3,12 +3,14 @@ module.exports = function (grunt) {
'Runs app in development mode.',
function () {
var commonTasks = [
'before-test',
'after-test',
'clean',
'html2js',
'build',
'less',
'copy',
'configureProxies',
'connect:dist',
'karma:watch',
'karma:watch:run',
'karma:watch:start',
'watch'
];

Expand Down
3 changes: 1 addition & 2 deletions grunt-tasks/shipit.js
Expand Up @@ -18,8 +18,7 @@ module.exports = function (grunt) {
tasks.push('bump-commit');

// build the code
tasks.push('before-test');
tasks.push('after-test');
tasks.push('default');

// push files to prod
tasks.push('cloudfiles:production');
Expand Down
4 changes: 4 additions & 0 deletions grunt-tasks/syntax-check.js
@@ -0,0 +1,4 @@
module.exports = function (grunt) {
// might want to add 'complexity' in the future when it's more standardized
grunt.registerTask('syntax-check', ['jshint', 'jscs']);
};
4 changes: 2 additions & 2 deletions src/rxApp/docs/rxApp.html
Expand Up @@ -26,9 +26,9 @@ <h3>Collapsible rxApp</h3>

<!--
You'll likely want to implement your HTML in your index.html file as:
<body ng-app="sampleApp">
<div ng-app="sampleApp">
<rx-app ng-view></rx-app>
</body>
</div>
And the template for each view/page will be something like:
<rx-page title="'Example Page'">
Expand Down
2 changes: 1 addition & 1 deletion src/rxApp/templates/rxApp.html
@@ -1,4 +1,4 @@
<div class="rx-app" ng-class="{collapsible: collapsibleNav === 'true', collapsed: collapsedNav}">
<div class="rx-app" ng-class="{collapsible: collapsibleNav === 'true', collapsed: collapsedNav}" ng-cloak>
<nav class="rx-app-menu">
<header class="site-branding">
<h1 class="site-title">{{ siteTitle || 'Encore' }}</h1>
Expand Down

0 comments on commit 94397e9

Please sign in to comment.