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

Add example of importing local file from a different path #19

Open
dandv opened this issue Jan 16, 2017 · 1 comment
Open

Add example of importing local file from a different path #19

dandv opened this issue Jan 16, 2017 · 1 comment

Comments

@dandv
Copy link
Contributor

dandv commented Jan 16, 2017

Say index.js imports a date utility function from ../utils/date. If we run babel-node lib/index/js, that will work. But the serve script, node dist/index.js will no longer work, because utils/date.js has an export statement, which Babel didn't transpile.

We could have utils/src/date.js transpiled to utils/lib/date.js, but then index.js needs to be changed to explicitly import utils/lib/date, and babel-node lib/index.js alone will no longer work correctly for development because utils/lib/date.js is outdated vs. utils/src/date.js.

@thejameskyle, what would be the best practice here?

@akbaruddink
Copy link

I'm facing the very same issue. Any suggestion/solution on this would be helpful.

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