Skip to content

Instantly share code, notes, and snippets.

@tyteen4a03
Created May 13, 2015 14:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyteen4a03/4b029481825162728986 to your computer and use it in GitHub Desktop.
Save tyteen4a03/4b029481825162728986 to your computer and use it in GitHub Desktop.
XenForo development helper scripts
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to match all subfolders:
// 'test/spec/**/*.js'
module.exports = function (grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// configurable paths
var config = {
app: 'upload/',
dist: '../'
};
grunt.initConfig({
config: config,
watch: {
upload: {
files: ['<%= config.app %>/**'],
tasks: ['sync:main']
}
},
sync: {
main: {
files: [{
expand: true,
cwd: '<%= config.app %>',
src: [
'**'
],
dest: '<%= config.dist %>'
}]
}
},
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '<%= config.app %>',
dest: '<%= config.dist %>',
src: [
'**'
]
}]
}
}
});
grunt.loadNpmTasks('grunt-newer');
grunt.registerTask('live', [
'build',
'watch'
]);
grunt.registerTask('build', [
'copy:dist'
]);
grunt.registerTask('default', [
'build'
]);
};
{
"name": "some-package",
"version": "some-version",
"repository": {
"type": "git",
"url": "https://github.com/yourusername/yourrepo"
},
"dependencies": {},
"devDependencies": {
"grunt": "~0.4.0",
"grunt-contrib-copy": "~0.4.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-newer": "~1.1.0",
"grunt-sync": "~0.0.6",
"load-grunt-tasks": "^1.0.0"
},
"engines": {
"node": ">=0.8.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment