Closed raphaelgoetter closed 10 years ago
You don't need this plugin anymore, you can handle multiple folders natively on brunch now :) Use this in your brunch config file (the folder names are an example) :
paths: {
"public": 'public',
"watched": ['app', 'dist', 'commons/app']
}
Hi thanks for answer. But assets and watchew folders are treated differently :watch only works with modified files witch have to be compiled. I have to copy/paste systematicly those folders, like assets (and not watched compiled files). Moreover, I have to paste thrm in differents folders.
How would You proceed that in native config file ?
(note that "_dev" is already watched in my config)
Yes sorry I didn't read your question very carefully yesterday ... I think I'd have to change the lib to allow multiple assets paths/destinations kinda like the grunt plugins works. It only adds one for the moment if I read my code right (I haven't used my plugin for a long time), but it shouldn't be really hard to adapt. Do you have any syntax that you would recommend ?
By the way, have you tried the convention option ? Once you have changed the watched folders (and added all you wanted), you might be able to do use something like that :
conventions: {
assets: function(path) {
path = path.replace(/\\/g, '/');
if((path.indexOf('app/assets') > -1 || path.indexOf('bookmarklet/assets') > -1) && path.indexOf('sprites/') === -1) {
return true;
}
}
}
This is something I use, you would have the adapt the function in order to use regex for files types and path I think. Note that it won't let you choose the destination folder and will keep the existing file hierarchy.
Hi (sinon, si t'es français, on peut en parler en français aussi ;))
I didn't manage with conventions.assets :/
Have you noticed @iamvdo 's fork (and pull request) ? https://github.com/iamvdo/assetsmanager-brunch
The idea seems promisefull.
The only issue is that only one destination can be provided.
It would be perfect with something like that :
plugins:
assetsmanager:
files: ['_dev/css/illust/*', '_dev/css/fonts/*'],
dest: ['css/illust', 'css/fonts']
Therefore :
'_dev/css/illust/*'
would be copy/pasted in 'css/illust'
folder'_dev/css/fonts/*'
would be copy/pasted in 'css/fonts'
folderWould it be possible ?
Oui en français ça me va. Je verrais plutot un truc comme ça:
plugins: {
assetsmanager: {
illust: {
files: ['_dev/css/illust/*'],
dest: ['css/illust']
},
fonts: {
files: ['_dev/css/fonts/*'],
dest: ['css/fonts']
}
}
}
C'est le principe des plugins grunt en règle général et ça reste plus modulable. Les noms des différents objets (illust / fonts) n'ont pas d'importance.
Sinon, mon fork semble fonctionner (hier soir il ne fonctionnait pas) :P
Ce qui donne:
plugins: {
assetsmanager: {
copyTo: {
'css/illust': ['_dev/css/illust/*'],
'css/fonts': ['_dev/css/fonts/*']
}
}
}
Et ainsi de suite ;)
Effectivement c'est beaucoup plus compact et tout aussi compréhensible
@iamvdo : hey cool !
Du coup, @ocombe, tu penses accepter le PR ou je dois basculer sur la version de @iamvdo ?
Oui je l'accepte dès qu'il a corrigé un petit truc dans la doc :)
Yay, et encore merci et vive la France :D
Hello,
Thank you for this plugin witch could be very useful.
I'm trying to manage several folders and destinations, but this code doesn't work for me :
Can you give me a little help ?
Thank you,
Raphaël