Created
January 7, 2014 21:29
-
-
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`.
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
// 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