Skip to content
This repository was archived by the owner on Mar 9, 2025. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants