-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Processing multiple files with a wildcard. #21
Comments
+1 That would be very handy |
You can dynamically build the files array with grunt to support this, and it doesn't need to be done per-task http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically |
That worked perfectly for me. Thanks @jsoverson for the pointer. For anyone else wanting to see an example using /*----------------------------------( PREPROCESS )----------------------------------*/
/**
* Grunt task around preprocess npm module.
*
* @see https://github.com/onehealth/grunt-preprocess
* @see https://github.com/onehealth/preprocess
* @see http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically
*/
preprocess : {
options : {
context : {
title : '<%= pkg.title %>',
description : '<%= pkg.description %>',
name : '<%= pkg.name %>',
version : '<%= pkg.version %>',
homepage : '<%= pkg.homepage %>',
},
},
dev : {
/*
files : {
'../dev/index.html' : './files/templates/index.html',
'../dev/layout.html' : './files/templates/layout.html',
}
*/
files: [
{
expand: true,
cwd: './files/templates/',
src: ['**/*.html'],
dest: '../dev/',
ext: '.html',
},
],
},
}, |
New feature request. I would like to be able to specify source as a wildcard, and destination as a directory. I have many html files (and JS files and CSS files) that I need to process for several environments over and over. Currently it appears that you can only specify a single file per line or per preprocess task. Unless I am mistaken, it seems that only inline will let you do wildcard preprocessing.
preprocess: {
html: {
src: './src/*/.html',
dest: './processed'
}
}
The text was updated successfully, but these errors were encountered: