You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
Say
index.js
imports a date utility function from../utils/date
. If we runbabel-node lib/index/js
, that will work. But the serve script,node dist/index.js
will no longer work, becauseutils/date.js
has anexport
statement, which Babel didn't transpile.We could have
utils/src/date.js
transpiled toutils/lib/date.js
, but thenindex.js
needs to be changed to explicitly importutils/lib/date
, andbabel-node lib/index.js
alone will no longer work correctly for development becauseutils/lib/date.js
is outdated vs.utils/src/date.js
.@thejameskyle, what would be the best practice here?
The text was updated successfully, but these errors were encountered: