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

Update start commands #6

Merged
merged 4 commits into from
Jan 10, 2022
Merged

Update start commands #6

merged 4 commits into from
Jan 10, 2022

Conversation

slifty
Copy link
Contributor

@slifty slifty commented Jan 7, 2022

This PR adds a npm run dev and also updatesnpm start to run off of transpiled code instead of through babel-node

To test this you need to run npm install

It also updates the build destination to be /build instead of /lib since that feels more explicit.

Resolves #5

We had our babel build over to /lib but really /build makes more sense.
This might be a somewhat pedantic change but I think it's a change worth
making since it is more explicit

This also uses the `babel` command rather than awkwardly pulling from
the node_modules (which... maybe we needed at one point but we don't
need any longer thanks to @babel/cli)
The nodemon package is super handy for development environments because
it makes it possible to run a service that automatically restarts on
code change.
We had our `start` command running via `babel-node` which... technically
works but is slower (and maybe less secure).

Instead we want our start command, which may be invoked in production,
to build and run from the transpiled version of the code.

We'll address the dev command in a future commit.
@slifty slifty self-assigned this Jan 7, 2022
Running `npm run dev` will now start the application via nodemon, so it
will auto-restart on code change.

Worth noting that dev wasn't a command before this.
Copy link
Member

@cecilia-donnelly cecilia-donnelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @slifty !

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.

babel-node isn't good for production
2 participants