browserify / browserify-handbook

how to build modular applications with browserify
Other
4.58k stars 291 forks source link

Added note about require with more than string literals #21

Closed adam-lynch closed 6 years ago

adam-lynch commented 10 years ago

Ran into this problem myself. It makes sense why it wouldn't work but took me awhile to realise it so it's worth noting.

Doesn't work:

requireAppScript = (moduleName) -> require '../../' + moduleName

requireAppScript 'x'

Works:

requireAppScript = (moduleName) -> require '../../' + moduleName

requireAppScript 'x'
require '../../x'
Raynos commented 10 years ago

:+1:

goto-bus-stop commented 6 years ago

thanks!