-
Notifications
You must be signed in to change notification settings - Fork 1.2k
A better require statement #433
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
A better require statement #433
Conversation
You need to add |
@chester1000 Sorry, but I don't know what |
In If you're using this, then it would be:
|
Oh wow, apparently I picked a bad name for my branch/PR. What I actually did was added a new global function in global.rootRequire = function (name) {
return require(__dirname + '/' + name);
} There wasn't any new package installs. |
Oops, my bad (: |
@kevinawoo If you could squash your commits into one that matches that format, it would be really nice. If you have any trouble please feel free to MSG me or send me an email and I'll gladly see what I can do. Thanks again for the PR! |
@kevinawoo, i'm wondering... Should
(btw, I threw in the use of It would allow for: Just a thought... |
Add: - global.rootRequire() is a require statement based from `server/` when generated Use to replace long, relative require statements e.g. `require('../../../auth/auth.service')` Closes angular-fullstack#430
You're absolutely right about As for the |
I see. My only thought was that if But I'm not sure if there would be much of a use case for that. Long story, short: |
@kingcody you did get me thinking about config.root though. Root always confused me a bit. "Did you mean root project, server root, ...client root??" Since we're here, what do you think about changing it to: config = {
...
path: {
project: ... '.',
client: ... '/client',
server: ... '/server'
},
...
} |
@kevinawoo you've made a good point. I'd definitely be interested to see what others have to say in regards to this. Although I will point out that it is a |
Closes issue #430 with a PR