Skip to content
This repository has been archived by the owner on Oct 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #6 from phawk/add_versioning
Browse files Browse the repository at this point in the history
Add node-version-assets
  • Loading branch information
phawk committed Mar 1, 2013
2 parents ce10fe6 + d15b82f commit 773f374
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 7 deletions.
15 changes: 14 additions & 1 deletion Gruntfile.js
Expand Up @@ -144,6 +144,19 @@ module.exports = function(grunt) {

});

// Version assets
grunt.registerTask('version-assets', 'version the static assets just created', function() {

var Version = require("node-version-assets");
var versionInstance = new Version({
assets: ['assets/stylesheets/styles.css', 'assets/javascripts/build.js'],
grepFiles: ['index.html']
});

var cb = this.async(); // grunt async callback
versionInstance.run(cb);
});

// Load Tasks
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-handlebars');
Expand All @@ -155,7 +168,7 @@ module.exports = function(grunt) {
// Define tasks
grunt.registerTask('test', ['jshint', 'handlebars', 'mocha']);
grunt.registerTask('styles', ['less']);
grunt.registerTask('build', ['test', 'requirejs', 'styles']);
grunt.registerTask('build', ['test', 'requirejs', 'styles', 'version-assets']);
grunt.registerTask('default', 'build');

};
File renamed without changes.
4 changes: 4 additions & 0 deletions changelog.md
@@ -1,5 +1,9 @@
# Recent changes

## 0.2.4 1st Mar 2013

* Add [node-version-assets](https://github.com/techjacker/node-version-assets) for cache busting

## 0.2.3 26th Feb 2013

* Add less compile step
Expand Down
4 changes: 2 additions & 2 deletions index.html
Expand Up @@ -13,7 +13,7 @@
<meta name="description" content="Description">

<!-- Stylesheets -->
<link rel="stylesheet" href="assets/stylesheets/styles.css">
<link rel="stylesheet" href="assets/stylesheets/styles.63138619ff9a4479affc273c23fb59da.css">

<!-- Favicons -->
<link rel="shortcut icon" href="assets/images/favicon.ico">
Expand All @@ -34,6 +34,6 @@
<!-- #content is where all content is loaded into from backbone views etc -->

<!-- Load compiled JS -->
<script src="assets/javascripts/build.js"></script>
<script src="assets/javascripts/build.006b52018d561f45ce8ec85d314e9cfa.js"></script>
</body>
</html>
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -13,5 +13,8 @@
"grunt-contrib-watch": "0.2.0rc7",
"grunt-mocha": "~0.2.1",
"grunt-contrib-less": "~0.5.0"
},
"dependencies": {
"node-version-assets": "0.0.6"
}
}
}
7 changes: 4 additions & 3 deletions readme.md
@@ -1,11 +1,12 @@
# Backbone Stack (0.2.3)
# Backbone Stack (0.2.4)

A pre-configured Backbone Stack for starting new projects, it alleviates a lot of the common boilerplate code and setup. It uses AMD modules, mocha for TDD and handlebars precompiled templates. Grunt plays a major role in automated linting, testing and building your code.

[![Build Status](https://travis-ci.org/phawk/Backbone-Stack.png?branch=master)](https://travis-ci.org/phawk/Backbone-Stack)

### Latest changes (26th Feb 2013)
### Latest changes (1st Mar 2013)

* Add [node-version-assets](https://github.com/techjacker/node-version-assets) for cache busting
* Add less compile step
* Add boostrap from bower

Expand Down Expand Up @@ -89,7 +90,7 @@ $ grunt test

## Building your code

All of the JavaScript is pre-build using [grunt](http://gruntjs.com/) and the r.js optimiser, this means your development environment better simulates what will be served in production.
All of the JavaScript is pre-build using [grunt](http://gruntjs.com/) and the r.js optimiser, this means your development environment better simulates what will be served in production. Your built CSS and JS are then version and your index.html file is automatically updated with the versioned filename.

```sh
# Watch src/ and test/ files and test, then build on change
Expand Down

0 comments on commit 773f374

Please sign in to comment.