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

refactor: transpile with babel #73

Merged
merged 1 commit into from May 28, 2021
Merged

refactor: transpile with babel #73

merged 1 commit into from May 28, 2021

Conversation

lukePeavey
Copy link
Owner

This allows us to use ES module syntax (import/export), and any other
modern javascript features that are not yet supported in node. The
babel config targets node version 14. Basically this just converts ES
modules to common js, since node already supports most modern
javascript.

In development mode, we use babel-node to start the server. This
transpiles the code at runtime. So you don't need to worry about a
build step when running in dev mode.

For production mode, the code is transpiled at build time to the
dist directory.

Instead of including require('dotenv').config() at the top of the
entry point, we now load dotenv via the command line.

This allows us to use ES module syntax (import/export), and any other
modern javascript features that are not yet supported in node. The
babel config targets node version 14. Basically this just converts ES
modules to common js, since node already supports most modern
javascript.

In development mode, we use babel-node to start the server. This
transpiles the code at runtime. So you don't need to worry about a
build step when running in dev mode.

For production mode, the code is transpiled at build time to the
`dist` directory.

Instead of including `require('dotenv').config()` at the top of the
entry point, we now load dotenv via the command line.
@lukePeavey lukePeavey merged commit 21b8423 into master May 28, 2021
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

Successfully merging this pull request may close these issues.

None yet

1 participant