Skip to content
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

Nonexistence of node_modules makes wrong paths #54

Open
VojtaStanek opened this issue Feb 7, 2017 · 3 comments
Open

Nonexistence of node_modules makes wrong paths #54

VojtaStanek opened this issue Feb 7, 2017 · 3 comments
Assignees

Comments

@VojtaStanek
Copy link

See: manGoweb/mango-cli#98

correct:
www/src/scripts/index

wrong:
/ekola/www/src/scripts/index

project root:
W:/rekola/www
@medikoo
Copy link
Owner

medikoo commented Feb 8, 2017

@cactucs Webmake detects root of a package, either by existance of top most node_modules folder or by existence of top most package.json file. If neither do not exist then root of the system will be assumed.

This behavior while may seem controversial, was intended (still it will be optimized with next major version). For now I would suggest to put package.json in root of a project, it will not do harm and it will indicate that we deal with root of node.js project.

The only issue I see is that path resolves to /ekola/www/src/scripts/index and not /rekola/www/src/scripts/index on your side (assuming root is W:/rekola/www). Is it indeed the case, or it's a typo on your side?

@medikoo medikoo self-assigned this Feb 8, 2017
@VojtaStanek
Copy link
Author

VojtaStanek commented Feb 8, 2017

Is it posible to pass root path (we have "replacement" file for package.json mango.json)?

@medikoo
Copy link
Owner

medikoo commented Feb 8, 2017

Is it posible to pass root path (we have "replacement" file for package.json mango.json)?

No, it follows npm and node.js rules, and that handling is deeply hardcoded.
So at this point the only options are:

  • You're fine with path going down to root
  • You provide either package.json file or node_modules folder to ensure proper detection of node project root
  • Wait for next major version (it'll not compute root not on basis of existence of package.json or node_modules, but on basis of top most bundled module).

Let me leave this issue open until we have other nicer project's root calculation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants