-
Notifications
You must be signed in to change notification settings - Fork 34
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
f9d8c05
commit b86e90b
Showing
17 changed files
with
775 additions
and
1,534 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,7 @@ | ||
# Sass | ||
.sass-cache | ||
|
||
# Grunt | ||
/node_modules/ | ||
/storefront/ | ||
npm-debug.log |
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,189 @@ | ||
/* jshint node:true */ | ||
module.exports = function( grunt ) { | ||
'use strict'; | ||
|
||
grunt.initConfig({ | ||
|
||
// JavaScript linting with JSHint. | ||
jshint: { | ||
options: { | ||
jshintrc: '.jshintrc' | ||
}, | ||
all: [ | ||
'Gruntfile.js', | ||
'assets/js/*.js', | ||
'!assets/js/*.min.js' | ||
] | ||
}, | ||
|
||
// Minify .js files. | ||
uglify: { | ||
options: { | ||
preserveComments: 'some' | ||
}, | ||
main: { | ||
files: [{ | ||
expand: true, | ||
cwd: 'assets/js/', | ||
src: [ | ||
'*.js', | ||
'!*.min.js' | ||
], | ||
dest: 'assets/js/', | ||
ext: '.min.js' | ||
}] | ||
} | ||
}, | ||
|
||
// Compile all .scss files. | ||
sass: { | ||
dist: { | ||
options: { | ||
require: 'susy', | ||
sourcemap: 'none', | ||
includePaths: require( 'node-bourbon' ).includePaths | ||
}, | ||
files: [{ | ||
'assets/css/style.css': 'assets/scss/style.scss', | ||
}] | ||
} | ||
}, | ||
|
||
// Minify all .css files. | ||
cssmin: { | ||
minify: { | ||
expand: true, | ||
cwd: 'assets/css/', | ||
src: ['*.css'], | ||
dest: 'assets/css/', | ||
ext: '.css' | ||
} | ||
}, | ||
|
||
// Watch changes for assets. | ||
watch: { | ||
css: { | ||
files: [ | ||
'assets/scss/*.scss' | ||
], | ||
tasks: [ | ||
'sass', | ||
'css' | ||
] | ||
}, | ||
js: { | ||
files: [ | ||
// Main js | ||
'assets/js/*js', | ||
'assets/js/**/*.js', | ||
'!assets/js/*.min.js' | ||
], | ||
tasks: ['uglify'] | ||
} | ||
}, | ||
|
||
// Generate POT files. | ||
makepot: { | ||
options: { | ||
type: 'wp-plugin', | ||
domainPath: 'languages', | ||
potHeaders: { | ||
'report-msgid-bugs-to': 'https://github.com/jameskoster/woocommerce-cart-tab/issues', | ||
'language-team': 'LANGUAGE <EMAIL@ADDRESS>' | ||
} | ||
}, | ||
frontend: { | ||
options: { | ||
potFilename: 'woocommerce-cart-tab.pot', | ||
exclude: [ | ||
'woocommerce-cart-tab/.*' // Exclude deploy directory | ||
], | ||
processPot: function( pot ) { | ||
pot.headers['project-id-version']; | ||
return pot; | ||
} | ||
} | ||
} | ||
}, | ||
|
||
// Check textdomain errors. | ||
checktextdomain: { | ||
options:{ | ||
text_domain: 'woocommerce-cart-tab', | ||
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 | ||
} | ||
}, | ||
|
||
// Creates deploy-able plugin | ||
copy: { | ||
deploy: { | ||
src: [ | ||
'**', | ||
'!.*', | ||
'!.*/**', | ||
'.htaccess', | ||
'!Gruntfile.js', | ||
'!package.json', | ||
'!node_modules/**', | ||
'!.DS_Store', | ||
'!npm-debug.log' | ||
], | ||
dest: 'woocommerce-cart-tab', | ||
expand: true, | ||
dot: true | ||
} | ||
} | ||
}); | ||
|
||
// Load NPM tasks to be used here | ||
grunt.loadNpmTasks( 'grunt-contrib-uglify' ); | ||
grunt.loadNpmTasks( 'grunt-wp-i18n' ); | ||
grunt.loadNpmTasks( 'grunt-checktextdomain' ); | ||
grunt.loadNpmTasks( 'grunt-sass' ); | ||
grunt.loadNpmTasks( 'grunt-contrib-cssmin' ); | ||
grunt.loadNpmTasks( 'grunt-contrib-watch' ); | ||
grunt.loadNpmTasks( 'grunt-contrib-copy' ); | ||
grunt.loadNpmTasks( 'grunt-contrib-jshint' ); | ||
|
||
// Register tasks | ||
grunt.registerTask( 'default', [ | ||
'css', | ||
'uglify' | ||
]); | ||
|
||
grunt.registerTask( 'css', [ | ||
'sass' | ||
]); | ||
|
||
grunt.registerTask( 'dev', [ | ||
'default', | ||
'makepot' | ||
]); | ||
|
||
grunt.registerTask( 'deploy', [ | ||
'makepot', | ||
'copy' | ||
]); | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.