Skip to content

Instantly share code, notes, and snippets.

@mason-stewart
Created January 28, 2014 02:08
Show Gist options
  • Save mason-stewart/8661209 to your computer and use it in GitHub Desktop.
Save mason-stewart/8661209 to your computer and use it in GitHub Desktop.
Run `npm install --save grunt-cdn`, and then add these bits to Gruntfile.js
grunt.initConfig({
// ...
cdn: {
options: {
/** @required - root URL of your CDN (may contains sub-paths as shown below) */
cdn: 'https://YOUR-USERNAME.github.io/YOUR-REPO/',
/** @optional - if provided both absolute and relative paths will be converted */
flatten: true
/** @optional - if provided will be added to the default supporting types */
// supportedTypes: { 'phtml': 'html' }
},
dist: {
/** @required - string (or array of) including grunt glob variables */
src: ['./dist/*.html', './dist/styles/{,*/}*{,*/}*.css']
/** @optional - if provided a copy will be stored without modifying original file */
// dest: './dist/static/'
}
}
//...
})
grunt.registerTask('build', [
//...
'cdn:dist'
]);
grunt.loadNpmTasks('grunt-cdn');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment