Open Nemo64 opened 10 years ago
Hmm, yeah, there definitely is big need for conditional js loading. I've been kinda hoping smart packages would actually become smart towards 1.0 but no news about that yet.
Would be very good to get everything loading if no bootstrap.json. Maybe it's possible to write npm helper inside the package to check if file exists?
Does this compiling result with new files to package's folder? If so, it needs to make difference between different apps using the same package in localhost.
I'll try to understand more this on better time, feel free to offer some examples in a separate branch.
Great! :+1:
BTW I think ngMeteor (Angular) project has some kind of meta-packages system built, there could be some interesting examples in their code.
I'm currently working on it. (fork ;))
Btw. was there any reason to rename the bootstrap files? Files in a package only get imported when they are mentioned in the package.js
which they aren't. It would be cleaner if bootstrap would be a sub repository. I guess it's to late for that. It would break everything to do that now!
Files were called .lessimport
before so meteor would've stopped treating them as less files eventually. No problem if they would've been just .less
in first place.
Well, now they're .import.less
then. :-)
OK, this is my try! I haven't fixed the issue with loading the javascript if no json file is present yet though.
oopps, i wanted to cancel the comment, not close the issue :D
Ok, this is more an idea so i want to discuss it.
Currently it is possible to load only less files that one needs in a project, which is awesome. But there are still all javascript files loaded. Most of my tiny projects do not need any of them.
My Idea is it to (ab)use meteors source handler to modify a
bootstrap.json
. This file would look like this:Not only would it reduce the clutter of the current bootstrap.less (it's cleaner) but it would allow to include js only when nessesary though
compileStep.addJavaScript
. I would create the less file then dynamically and add it withcompileStep.addAsset
.This could also be sort of backwards compatible because the bootstrap.less of project that already use this package would still work. I currently don't know if it would be possible to include the javascript if no
bootstrap.json
is found.Any thoughts?