Meteor client side require


Hello guys,

What is difference between require(StringPath) and require(variable)

I have some problem:
For example:
require '../../ui/pages/' it works
path = '../../ui/pages/'
require path
Doesn’t work, and I get console error
Error: Cannot find module '../../ui/pages/'

What’s going on ?


If you don’t set a static string in your require, the meteor compiler will not know that your file needs to be included in your app (especially if it is in an imports directory).


Thx you, you are right! I learned the import source