Skip to content

How to watch dev when file changes faster #230

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

Closed
thanhdevapp opened this issue May 3, 2017 · 4 comments
Closed

How to watch dev when file changes faster #230

thanhdevapp opened this issue May 3, 2017 · 4 comments

Comments

@thanhdevapp
Copy link

When i change write new code, i need npm run build:dev to change view in browser, pls help

i using dotnet watch run

@thanhdevapp
Copy link
Author

thanhdevapp commented May 3, 2017

I found using bold dotnet watch run and npm run watch:dev but wait 3 - 5s to rebuild webpack

Please guide me, if any other way faster

@thanhdevapp thanhdevapp changed the title How to npm run build:dev when file changes How to watch dev when file changes faster May 3, 2017
@markoj21
Copy link
Contributor

markoj21 commented May 3, 2017

I found webpack-dev-server to be the fastest option as it keeps all the files in memory and it compiles the files the quickest. The HRM rebuild still takes about 2-3 seconds, this is dependent on your machine and browser (Chrome was the quickest).

https://webpack.github.io/docs/build-performance.html (from the website)
Make sure you don’t do a full rebuild. Webpack has a great caching layer that allows you to keep already compiled modules in memory. There are some tools that help to use it:

webpack-dev-server: Serves all webpack assets from memory. Best performance.
webpack-dev-middleware: The same performance as webpack-dev-server for advanced users.
webpack –watch or watch: true: Caches stuff but write assets to disk. Ok performance.

@Adondriel
Copy link
Contributor

Have you found a way to watch the server side files, and rebuild the serverside? Idk if it's the changes I made, or if the server side files just don't get watched...

@isaacrlevin
Copy link
Contributor

@Adondriel what do you mean by server side files? Compiled js files?

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

4 participants