Skip to content

Instantly share code, notes, and snippets.

@mason-stewart
Created January 7, 2014 21:29
Show Gist options
  • Save mason-stewart/8307222 to your computer and use it in GitHub Desktop.
Save mason-stewart/8307222 to your computer and use it in GitHub Desktop.
This will prep your urls to work from a subfolder when deployed to GH pages, but still work locally. You'll also need to run `npm install --save grunt-cdn`.
// add this to your configuration
cdn: {
options: {
cdn: '//YOUR-USERNAME.com/YOUR-REPO-NAME/',
flatten: true
},
dist: {
src: ['./dist/*.html', './dist/styles/{,*/}*{,*/}*.css']
}
}
// end cdn config
// in your build task config
grunt.registerTask('build', [
...
// Add this as the last step in your build task
'cdn:dist'
]);
// don't forget to register the task
grunt.loadNpmTasks('grunt-cdn');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment