Let's say I have an external dependency like Bootstrap. I'd like to import some LESS from there, because that way I can use Bootstrap mixins in my code.
Since Meteor is already compiling and concatenating all of the LESS in my tree (right?), just copying the LESS directory and then manually updating it once in a while is not a solution. In fact, with the default LESS directory, it seems every LESS source file will appear in the output twice: once because it's imported in bootstrap.less
, once because of the file itself.
Is there a way to get meteor to ignore some paths? public/
sounds close; but I don't really want to serve the bootstrap repo.
Plus, that might fix it for LESS, but what's the appropriate way to handle the JS extensions in bootstrap?
I have figured out a potential solution. Meteor wants to bundle everything in its directory... so let's put the dependencies outside of its reach :)
With the following directory structure:
.
|-- ext
| `-- bootstrap
`-- myapp
|-- .meteor
`-- ...
In my LESS file, I do the following:
@BOOTSTRAP: "../../ext/bootstrap/less";
@import "@{BOOTSTRAP}/reset.less";
This still doesn't work, but I think this is attributable to a LESS bug.
Unfortunately the error message produced by Meteor is completely useless here:
[[[[[ ~/Code/igl/igl ]]]]]
Running on: http://localhost:3000/
Errors prevented startup:
Exception while bundling application:
ReferenceError: err is not defined
at /usr/local/meteor/packages/less/package.js:33:62
at [object Object].add_file (/usr/local/meteor/app/lib/bundler.js:193:5)
at /usr/local/meteor/app/lib/bundler.js:97:16
at Array.forEach (native)
at Function.<anonymous> (/usr/local/meteor/app/lib/third/underscore.js:76:11)
at /usr/local/meteor/app/lib/bundler.js:96:11
at Array.forEach (native)
at Function.<anonymous> (/usr/local/meteor/app/lib/third/underscore.js:76:11)
at Object.add_files (/usr/local/meteor/app/lib/bundler.js:95:9)
at [object Object].on_use (/usr/local/meteor/app/lib/packages.js:136:11)
Your application is crashing. Waiting for file change.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With