Closed jonathanong closed 10 years ago
pretty sure chrome has fuzzy(er) matching now
what do you mean?
one of the issues was people didnt want to use index.js
so they wanted main to do the work for them still. but we use index.js
for everything, and the matching has improved a lot so you can look by component name now and not get screwed like before while debugging
what does that have to do with chrome, though?
are you saying we could/should omit it now? i think it should default to index.js
or scripts[0]
im saying the want to not name things index.js
should be greatly reduced now, and it seems like the debugging tools problem.
although i think main = scripts.length == 1 ? scripts[0] : 'index.js'
might be better. otherwise with multiples it might be too much to assume.
regardless we should have a nicer failure state cuz ive been bitten by forgetting it a lot
yeah, i'm down for that too.
Any chance of main
being implicitly included in scripts
?
@dominicbarnes i'm meh on that. i'd rather be able to just do "scripts": "module.js"
.
another issue is globs without a main
. there's no order, so you can't just do script[0]
. we'd either have to force a main
, or check/require an index.js
within the glob.
@visionmedia opinions? otherwise i'm going to do main = scripts.length == 1 ? scripts[0] : 'index.js'
and throw if scripts[0].indexOf('*') !== -1
@visionmedia what's your opinion on this?
i'm thinking that this is more of an implementation detail. if you don't specify a main file, then the builder can magically assume whatever it wants.
going to close for now. my opinion now is that the builder should be able to infer the main
and be flexible with it. we can reopen if people actually run into issues.
https://github.com/component/builder.js/issues/34