wp-cw/gruntfile.js

111 lines
2.1 KiB
JavaScript
Raw Normal View History

2014-07-09 20:44:45 -07:00
module.exports = function ( grunt ){
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON( 'package.json' ),
uglify: {
options: {
mangle: false
},
dist: {
expand: true,
cwd: 'js',
src: ['*.js','!*.min.js'],
dest: 'js',
ext: '.min.js'
}
},
jshint: {
options: {
node: false,
curly: false,
eqeqeq: true,
immed: true,
latedef: true,
newcap: true,
noarg: true,
sub: true,
undef: true,
unused: true,
boss: true,
eqnull: true,
browser: true,
globals: {
'jQuery': true,
'wp': true,
'module': true
}
},
gruntfile: {
src: 'gruntfile.js'
},
lib_test: {
src: ['js/*.js', '!js/*.min.js']
}
},
sass: {
options: {
style: 'expanded'
},
dist: {
files: {
'css/cwv3.css': 'css/sass/cwv3.scss'
}
}
},
cssmin: {
minify: {
src: 'css/cwv3.css',
dest: 'css/cwv3.min.css',
}
},
2014-07-09 22:20:39 -07:00
rsync: {
options: {
args: ["--verbose", "--archive"],
exclude: ["node_modules",".*","README.md"],
recursive: true
},
dist: {
options: {
src: "./",
2014-07-09 22:23:49 -07:00
dest: "~/svn/content-warning-v2/trunk"
2014-07-09 22:20:39 -07:00
}
}
},
2014-07-09 20:44:45 -07:00
watch: {
gruntfile: {
files: '<%= jshint.gruntfile.src %>',
tasks: ['jshint:gruntfile']
},
lib_test: {
files: '<%= jshint.lib_test.src %>',
tasks: ['jshint:lib_test']
},
css: {
files: 'css/**/*.scss',
tasks: ['sass', 'cssmin']
},
js: {
files: ['js/*.js', '!js/*.min.js'],
tasks: ['uglify']
2014-07-09 22:20:39 -07:00
},
readme: {
files: ['readme.txt', 'content-warning-v3.php'],
tasks: ['rsync']
2014-07-09 20:44:45 -07:00
}
}
});
// These plugins provide necessary tasks
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
2014-07-09 22:20:39 -07:00
grunt.loadNpmTasks('grunt-rsync');
2014-07-09 20:44:45 -07:00
// Default task
grunt.registerTask('default', ['jshint', 'sass', 'uglify', 'cssmin']);
2016-09-30 08:47:43 -07:00
grunt.registerTask( 'scripts', ['jshint','uglify'] );
grunt.registerTask('sync', ['rsync']);
2014-07-09 20:44:45 -07:00
};