Last active
January 4, 2016 15:19
-
-
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 file contains 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
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 |
This file contains 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
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