Last active
August 29, 2015 14:05
-
-
Save craigmdennis/5d25158e747a85cb55ad to your computer and use it in GitHub Desktop.
Rename file extensions with Grunt copy.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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