-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ~ path syntax in require #545
Comments
What do you think of: var mymodule = global.require('./path1/path2/mymodule'); as an alternative? This is already implemented in the master branch of NativeScript for iOS. |
Or there's always |
The string convention seems easier to use to me and is tied with less implicit logic underneath. Additionally, we may provide a property at the var fs = require("file-system");
var appRoot = fs.path.appRoot;
var myModulePath = fs.path.join(appRoot, "my-module");
var myModule = require(myModulePath); |
Tilde (require(' |
@atanasovg: I would advise against tightly coupling the application assets, including any JavaScript files, to a filesystem idiom. Whether we load assets from a filesystem or something like In general I am against this change. I would much rather we reverted to simpler times when absolute paths passed to |
I tend to agree agree with fealeaenpae. If the concept of a "root" path is in the system then you should be able to use '/' as the first character to resolve to root. var mymodule = require('/path1/path2/mymodule'); This is consistent with both the web definition of the "root" http://www.motive.co.nz/glossary/linking.php?ref and linux/unix |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Support ~ path syntax in
require
. For exampleSee:
The text was updated successfully, but these errors were encountered: