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

start-dev and dev are not working #16

Open
T-vK opened this issue Aug 14, 2019 · 1 comment
Open

start-dev and dev are not working #16

T-vK opened this issue Aug 14, 2019 · 1 comment

Comments

@T-vK
Copy link

T-vK commented Aug 14, 2019

I wanted to use this project as a base for a new one, but it's really frustrating to constantly run npm run build (which takes forever) and then npm start again.
I saw there are 2 run scripts start-dev and dev in the package.json, but when I run the start-dev script, it just never updates and always provides the old files. The dev script is even worse, I mean it appears as if it would do something, but on localhost:3000 there is nothing and I didn't see a reference to another port anywhere.

@NC-Development
Copy link

NC-Development commented Oct 20, 2019

You run npm run dev in one console. This sets webpack to run forever in that console, watching for file changes

then you open a 2nd console, and run npm run start-dev which will trigger nodemon to watch the entire project for file changes, and restart the server

to make nodemon not trigger for every change,but only on the "rebuilt" changes:

change the dev-start script to: nodemon --watch dist --watch dist-server dist-server/main.js

This tells nodemon to only restart the server when the packaged files change

BONUS: Add the following to the webpack.config to force webpack to wait for 2.5 seconds before rebuilding files (cuts down on builds triggering while you are making changes if you use something like autosave)

,
  watchOptions: {
    aggregateTimeout: 2500
  },

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

No branches or pull requests

2 participants