Open MajorBreakfast opened 10 years ago
I agree. :)
(Semi-relatedly, I wonder if the whole interface is due for an overhaul. I'm not terribly happy with it.)
Observation: We always use '/'
as srcDir in ember-cli
Cool would be:
// Brocfile
// import pick, merge
var es6Concatenator = new ES6Concatenator({
loaderFile: 'loader/loader.js',
inputFiles: [prefix + '/**/*.js'],
outputFile: '/assets/app.js'
});
var coffee = new Coffee();
module.exports = merge(
pick('index.html'),
pick(['app/**/*', 'vendor/**/*']).to(coffee).to(es6Concatenator)
pick('vendor').pick('cool.js')
)
^^' I'm being creative again. All I'm saying is that you're probably right: There is most definitly a briefer and more elegant way to pick files and wire it all up.
I originally wanted something like .to
, but it would have to be added to the plugin API, and I want that API to stay as simple as humanly possible. (Tyler Kellen from the Grunt project impressed upon me that every extra piece of plugin API is terrible because you'll end up having to maintain it forever.)
+1
match('app/**/*')
match('app/**/*', 'vendor/**/*')
Something like to
makes sense to me. I think the Brocfile.js result would be cleaner and more descriptive.
One example with rake-pipeline:
match 'submodules/ember.js/packages_es6/*/lib/*.js' do
filter ES6ModuleFilter
filter Rakep::HandlebarsPrecompiler
concat 'app.js'
end
@ppcano It would be kinda nice. But now I think that it doesn't need to be in the core. It could be just a library. That way the underlying interface can stay minimal and we can have syntax sugar.
I've got a fork which sets srcDir
and destDir
to '/'
by default, and that also supports passing files
directly instead of wrapping in it an object, so that you can do stuff like
var es6Modules = pickFiles(src, [
'**/*.js',
'!main.js'
]);
Have a look at https://github.com/stefanfisk/broccoli-static-compiler.
+1
broccoli-funnel is basically a drop in replacement and uses /
as a default for srcDir and destDir.
I'm big +1 on literally any other package than broccoli-static-compiler, maintained by literally anyone other than me ;-) Yay for funnel!
LOL
-> title :)