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

DX: Consider using NODE_PATH #92

Closed
adnasa opened this issue Oct 3, 2016 · 4 comments
Closed

DX: Consider using NODE_PATH #92

adnasa opened this issue Oct 3, 2016 · 4 comments

Comments

@adnasa
Copy link
Member

adnasa commented Oct 3, 2016

I think that it is time that we start considering setting NODE_PATH to set a specific folder as the source of truth for loading modules, beyond the node_modules folder.

The aim is to the have the following (example)

before

import paths from '../../../utils/paths'

after

import paths from 'core/utils/paths'
@vutran
Copy link
Member

vutran commented Oct 3, 2016

It looks like NODE_PATH was deprecated a while back.

@adnasa
Copy link
Member Author

adnasa commented Oct 3, 2016

Leaving this open, until we've found a better option then.

@vutran
Copy link
Member

vutran commented Oct 10, 2016

I've been thinking of this and perhaps using webpack's resolve.root or resolve.moduleDirectories would work. An idea would be using the package name dext for absolute imports.

before

import Button from '../../../src/components/Button.js';

after

import Button from 'dext/app/renderer/src/components/Button.js'

Otherwise, we can split it based on the Electron process (main/renderer)

// source: app/main/themes
import themes from 'dext-main/themes';

// source: app/renderer/src/components
// - removes the "src" from the path string (side note: to be removed in the future)
import Button from 'dext-renderer/components/Button';

@adnasa
Copy link
Member Author

adnasa commented Mar 14, 2018

Since we are considering lerna when we are going to consolidate our packages, there is no need for this right now

@adnasa adnasa closed this as completed Mar 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants