Skip to content

Instantly share code, notes, and snippets.

@jasonvarga
Last active January 4, 2016 15:19
Show Gist options
  • Save jasonvarga/8640172 to your computer and use it in GitHub Desktop.
Save jasonvarga/8640172 to your computer and use it in GitHub Desktop.
Using Grunt to copy Statamic add-on files to a sandbox site
This assumes your folder structure looks like this:
myaddon/
_add-ons/
myaddon/
js/
css/
vendor/
ft.myaddon.php
hooks.myaddon.php
pi.myaddon.php
tasks.myaddon.php
_config/
add-ons/
myaddon/
myaddon.yaml
node_modules/
package.json
Gruntfile.js
module.exports = function(grunt) {
grunt.initConfig({
concat: {
// js stuff
},
uglify: {
// more js stuff
},
sass: {
// css stuff
},
copy: {
main: {
files: [
{
expand: true,
cwd: '_add-ons/bison/',
src: '**',
dest: '/path/to/my/sandbox/site/_add-ons/bison/'
}
]
}
},
watch: {
options: { livereload: true },
css: {
// css stuff
}
js: {
// js stuff
},
php: {
files: ['_add-ons/bison/**/*.*'],
tasks: ['copy']
}
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-copy');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment