-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1eb52a0
commit bc1096b
Showing
60 changed files
with
12,402 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
/*jshint node:true */ | ||
module.exports = function( grunt ) { | ||
'use strict'; | ||
|
||
grunt.initConfig({ | ||
|
||
// Setting folder templates. | ||
dirs: { | ||
css: 'assets/css', | ||
fonts: 'assets/fonts', | ||
images: 'assets/images', | ||
js: 'assets/js' | ||
}, | ||
|
||
// Gets the package vars. | ||
pkg: grunt.file.readJSON( 'package.json' ), | ||
|
||
// Javascript linting with jshint. | ||
jshint: { | ||
options: { | ||
jshintrc: '.jshintrc' | ||
}, | ||
all: [ | ||
'Gruntfile.js', | ||
'<%= dirs.js %>/*.js', | ||
'!<%= dirs.js %>/*.min.js' | ||
] | ||
}, | ||
|
||
// Minify .js files. | ||
uglify: { | ||
options: { | ||
preserveComments: false | ||
}, | ||
dist: { | ||
files: [{ | ||
expand: true, | ||
cwd: '<%= dirs.js %>/', | ||
src: [ | ||
'*.js', | ||
'!*.min.js' | ||
], | ||
dest: '<%= dirs.js %>/', | ||
ext: '.min.js' | ||
}] | ||
} | ||
}, | ||
|
||
// Minify all .css files. | ||
cssmin: { | ||
minify: { | ||
expand: true, | ||
cwd: '<%= dirs.css %>/', | ||
src: [ | ||
'*.css', | ||
'!*.min.css' | ||
], | ||
dest: '<%= dirs.css %>/', | ||
ext: '.min.css' | ||
} | ||
}, | ||
|
||
// Watch changes for assets | ||
watch: { | ||
css: { | ||
files: [ | ||
'<%= dirs.css %>/*.css', | ||
'!<%= dirs.css %>/*.min.css' | ||
], | ||
tasks: ['cssmin'] | ||
}, | ||
js: { | ||
files: [ | ||
'<%= dirs.js %>/*js', | ||
'!<%= dirs.js %>/*.min.js' | ||
], | ||
tasks: ['jshint', 'uglify'] | ||
} | ||
}, | ||
|
||
// Create .pot files | ||
makepot: { | ||
dist: { | ||
options: { | ||
type: 'wp-plugin' | ||
} | ||
} | ||
}, | ||
|
||
// Check Text Domain | ||
checktextdomain: { | ||
options:{ | ||
text_domain: '<%= pkg.name %>', | ||
keywords: [ | ||
'__:1,2d', | ||
'_e:1,2d', | ||
'_x:1,2c,3d', | ||
'esc_html__:1,2d', | ||
'esc_html_e:1,2d', | ||
'esc_html_x:1,2c,3d', | ||
'esc_attr__:1,2d', | ||
'esc_attr_e:1,2d', | ||
'esc_attr_x:1,2c,3d', | ||
'_ex:1,2c,3d', | ||
'_n:1,2,4d', | ||
'_nx:1,2,4c,5d', | ||
'_n_noop:1,2,3d', | ||
'_nx_noop:1,2,3c,4d' | ||
] | ||
}, | ||
files: { | ||
src: [ | ||
'**/*.php', // Include all files | ||
'!node_modules/**' // Exclude node_modules/ | ||
], | ||
expand: true | ||
} | ||
} | ||
}); | ||
|
||
// Load tasks | ||
grunt.loadNpmTasks( 'grunt-contrib-watch' ); | ||
grunt.loadNpmTasks( 'grunt-contrib-jshint' ); | ||
grunt.loadNpmTasks( 'grunt-contrib-uglify' ); | ||
grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); | ||
grunt.loadNpmTasks( 'grunt-wp-i18n' ); | ||
grunt.loadNpmTasks( 'grunt-checktextdomain' ); | ||
|
||
// Register tasks | ||
grunt.registerTask( 'default', [ | ||
'jshint', | ||
'uglify', | ||
'cssmin' | ||
]); | ||
}; |
Oops, something went wrong.
bc1096b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opa @viniciuslizarte beleza? Esse novo plugin tem alguma previsão para lançamento? Abraços