Faster Webpack builds
Created by: sqs
This PR significantly speeds up Webpack initial and incremental builds of TypeScript and SCSS:
- 25% faster initial build time (31s -> 23s)
- 74% faster TypeScript incremental builds (3.7s -> 1.0s)
- 47% faster SCSS incremental builds (5.5s -> 2.9s)
See commit messages for a discussion of each change.
Benchmarks:
- Initial build:
goreman run restart web
and look forTime: ...
- TypeScript incremental build:
echo '/* a */' >> web/src/SourcegraphWebApp.tsx
and look forTime: ...
- SCSS incremental build:
echo '/* a */' >> web/src/SourcegraphWebApp.scss
and look forTime: ...
(All on the same computer, with nothing else running.)
master
branch:
- Initial build: 31067ms
- TypeScript incremental build: 3684ms
- SCSS incremental build: 5519ms
faster-webpack
branch:
- Initial build: 23310ms (-25%)
- TypeScript incremental build: 966ms (-74%)
- SCSS incremental build: 2938ms (-47%)