Skip to content

Instantly share code, notes, and snippets.

@jfeldstein
Created December 6, 2013 02:16
Show Gist options
  • Save jfeldstein/7817536 to your computer and use it in GitHub Desktop.
Save jfeldstein/7817536 to your computer and use it in GitHub Desktop.
How to modify the default Gruntfile generated by generator-backbone to support building assets into a Phonegap app nested inside the project.
// ...
module.exports = function (grunt) {
// ...
// configurable paths
var yeomanConfig = {
app: 'app',
dist: 'dist',
phonegap: 'phonegap/www'
};
grunt.initConfig({
// ...
clean: {
dist: ['.tmp', '<%= yeoman.dist %>/*'],
phonegap: ['<%= yeoman.phonegap %>/*', '!<%= yeoman.phonegap %>/config.xml'],
server: '.tmp'
},
copy: {
dist: {
// ...
},
phonegap: {
files: [
{
expand: true,
cwd: '<%= yeoman.dist %>',
src: ['**'],
dest: '<%= yeoman.phonegap %>'
}
]
}
},
// ...
});
// ...
grunt.registerTask('build', [
// ...
// Change 'copy' -> 'copy:dist'
'copy:dist',
// ...
// Update Phonegap www
'clean:phonegap',
'copy:phonegap'
]);
// ...
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment