Skip to content

Instantly share code, notes, and snippets.

@craigmdennis
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save craigmdennis/5d25158e747a85cb55ad to your computer and use it in GitHub Desktop.
Save craigmdennis/5d25158e747a85cb55ad to your computer and use it in GitHub Desktop.
Rename file extensions with Grunt copy.
// Compile Jade (allowing for php)
jadephp: {
options: {
pretty: true
},
// Compile templates to HTML in .tmp so we can run useminPrepare
dist: {
files: [
{
expand: true,
cwd: '<%= config.app %>/templates',
dest: '.tmp/templates',
src: '*.jade',
ext: '.html'
},
]
},
},
copy: {
dist: {
files: [
{
// Copy HTML tempaltes and convert them to php
expand: true,
dot: true,
cwd: '.tmp/templates',
dest: '<%= config.dist %>/templates',
src: '*.html',
ext: '.php' // Change the file ext
}
]
}
},
grunt.registerTask('build', [
'jadephp:dist',
'useminPrepare',
'concat',
'uglify',
'cssmin',
'usemin' // Performs the rewrites
'copy:dist' // Moves the files and changes the ext to .php
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment