Closed MartinKolarik closed 10 years ago
With relative paths like ./module/file.js
. While ./
usually refers to process.cwd()
, with require()
it's relative to the file calling require()
- that is useful in most cases, but in this case it means we would have to use paths relative to node_modules/ractive-load/
.
ah, got you. Wouldn't you want the path to be relative to the component definition file though? (Genuine question.) Also, would this work on Windows, or would we need to use path.join()
instead?
dependency = require( path.join( process.cwd(), name ) );
Wouldn't you want the path to be relative to the component definition file though?
That would make sense. The question is, how do we know the path of the component definition?
Also, would this work on Windows, or would we need to use path.join() instead?
Windows supports both /
and \
. path.join()
is useful when you don't know if there is a trailing slash or not and/or when dealing with certain command line tools (these can have problems with using /
), but in most cases simple string concentration is fine.
Btw, can you npm publish
please?
done - bumped version to 0.2.3
Thanks.
I don't totally follow what's going on here - when wouldn't the standard
require()
path resolution work?