This repository was archived by the owner on Mar 9, 2025. It is now read-only.
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
Description
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?
Metadata
Metadata
Assignees
Labels
No labels