I am trying to understand if this is expected behaviour or a bug
Let’s assume we have:
// /imports/foo.js
export const foo = 'foo';
if I want to
const { foo } = require('./imports/foo')
I get an error telling me that module ./imports/foo cannot be found
But, if somehow ./imports/foo
is already imported somewhere else in the app, such that it ends up within the module import chain (final build), I can import it in the shell as well.
BTW, the same goes for the browser, which makes sense, such that unused code don’t end up at the browser.
BUT, meteor shell is a development REPL environment and it should make sense that I try out my new code in the shell before actually importing it in my app.
So, is this a bug, an expected behavior or lack of knowledge on my part?
PS: I so cannot resist pinging you here @benjamn