You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works well both with in dev and production and is OS-agnostic as we compile the path using path.join(). Furthermore, in combination with #61, the const root can be entirely removed as it's not used anymore.
Let me know if I should prepare the PR for this one too.
The text was updated successfully, but these errors were encountered:
Absolutely. But you are aware of that the implication of this is that the process must be launched from a directory that actually contains public?
jw@abc ~ % node test.js
process.cwd() is /Users/jw
jw@abc ~ % cd dev
jw@abc dev % node ../test.js
process.cwd() is /Users/jw/dev
I think it's better, given how this generator is constructed (and I've implemented the change in my project as I found it more useful) - but it does changes the current behaviour.
Currently we use
__dirname
(which returns the path ofserver.js
) as starting point in finding our way to/public
.generator-express-no-stress/app/templates/server/common/server.js
Line 17 in 53082f9
generator-express-no-stress/app/templates/server/common/server.js
Line 30 in 53082f9
There are two issues with this scenario:
/dist
,/public
is just one directory up fromserver.js
, not two)I propose a solution that uses
process.cwd()
instead. Given that we launch the process from/
, it's an easy task to find/public
:This works well both with in dev and production and is OS-agnostic as we compile the path using
path.join()
. Furthermore, in combination with #61, theconst root
can be entirely removed as it's not used anymore.Let me know if I should prepare the PR for this one too.
The text was updated successfully, but these errors were encountered: