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

Improve compilation speed for development builds #402

Merged
merged 2 commits into from
May 14, 2021

Conversation

Ruin0x11
Copy link
Contributor

@Ruin0x11 Ruin0x11 commented May 9, 2021

  1. Use watchify for incremental builds instead of naive polling (npm run watch). Speeds up the time between changes by ~17x.
  2. When running npm run watch, set the environment as development, and open a websocket for live reloading. The event for live reloading is sent when any template/CSS/JS is changed. Can be disabled by passing --no-live-reload to build.js.
  3. Better formatting of errors during incremental compilation.

@neobooru
Copy link
Collaborator

neobooru commented May 9, 2021

Looks good.
I do have a small thing to nitpick about though. When you build the site for production (aka simple npm run build) the live-reloading code is still embedded into the app. I know something like webpack could remove this, but we aren't using that at the moment.
I assume it would be rather hard to remove those lines from the production build using our current build system, but I'm just asking to make sure.

@Ruin0x11
Copy link
Contributor Author

Ruin0x11 commented May 9, 2021

Maybe we should create a template that holds main.js and autogenerate it like with the HTML templates? It might make the code for that less clean though.

@neobooru neobooru merged commit a6886dd into rr-:master May 14, 2021
@neobooru
Copy link
Collaborator

Thanks for your work 👍
I squashed it to avoid adding the watch.sh to our history.

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.

2 participants