-
Notifications
You must be signed in to change notification settings - Fork 705
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
organizing assets #295
Comments
Thanks for the suggestion, I thought about it a few times, but each time I realized that paths will differ from task to task. For example, sometimes you might perform a task on all HTML files and sometimes you'd like to exclude Unlike All in all, I see little room (and reason) for automation in that area. If a specific setup worked for you much better, feel free to share it 😃 |
For this: var paths = {
scripts: ['scripts/**/*.js', '!scripts/libs/**/*.js'],
libs: ['scripts/libs/jquery/dist/jquery.js', 'scripts/libs/underscore/underscore.js', 'scripts/backbone/backbone.js'],
styles: ['styles/**/*.css'],
html: ['index.html', '404.html'],
images: ['images/**/*.png'],
extras: ['crossdomain.xml', 'humans.txt', 'manifest.appcache', 'robots.txt', 'favicon.ico'],
};
Sure. For this: var bases = {
app: 'app/',
dist: 'dist/',
}; There is no reason to not do this. I do this on every gulpfile I make. Especially when bases with vinyl get complicated. |
In my opinion it decreases readability for very little gain. You can change those with search & replace. |
What is not readable about variables? This is exactly what variables are for. |
@austinpray I forget what |
Variables are convenient if changing their value will save time. In this case a simple search & replace for
Variables are usually for making the code shorter and more flexible. This will not make the code shorter and, in my opinion, not that flexible either. bases.app + 'scripts/**/*.js'
// vs
'app/scripts/**/*.js' The former is less readable and takes longer to type. |
This is just my opinion, I'll wait for others from the team to share theirs 😃 |
@silvenon, agreed, it's only when |
Forgive me, I just realized why I initially thought this was a good idea again. Please, ring in on your thoughts: Imagine I wanted to just update to the latest version of gulp-webapp. I'd have to surgically go through every single task (making sure I don't miss one) to update the path to my assets whereas I could just copy over the old Would this be desirable? |
I previously had a hunch that it might be, but realistically if you want to change I never felt a need to do this (unlike in a Do you have a use case where updating paths wouldn't be simple without variables? |
I feel it's more clear without using variables. Because paths in I think this is more a matter of taste than actual usefulness. Closing this. |
Does anyone think it's worth organizing all the paths for sources and dests in a single object?
Example use:
*I just copied this from an article I found: http://www.justinmccandless.com/blog/A+Tutorial+for+Getting+Started+with+Gulp
This could possibly make things easier to update whenever someone wants to perform an upgrade in the future?
The text was updated successfully, but these errors were encountered: