Closed rhyslbw closed 8 years ago
This is a hack to make the Meteor build tool include this files in the built app, when nothing of the app code requires this files yet. With this hack Chimp can require this files in server.execute
blocks. Without it, the files would not be included in the built Meteor app and couldn't be required in server.execute
blocks.
Ok so this allows code to be written without needing it to be imported into some part of the app, and suits a TDD workflow. Anyone interested, here's the background: https://github.com/meteor/meteor/issues/6068#issuecomment-178940948
Given this is a standard development approach and we can't just require the file in the test at runtime, it would be nice to at least improve the current situation.
Some ideas:
is(notYetImported)
addToBuild()
Digging a little deeper I can see this is being thought about and tracked elsewhere. Will close this for now
I'm trying to better understand module-loader.js (or on server):
Can you explain this in more detail? What confuses me is why there's a conditional that will never evaluate to true, and therefore never be called