simplify frontend CSS build in Webpack
Created by: sqs
Previously, our Webpack build had a separate set of entrypoints for CSS (vs. TypeScript). It also had a hack to avoid a red-herring 404 in the devtools browser console when running Sourcegraph in local dev (which does not produce .css
output files; it uses style-loader
to inject styles via JavaScript so we get hot-reloading, ie instant feedback for CSS changes).
Now, it only has a single set of (TypeScript) entrypoints that, in turn, import the relevant CSS files. Also, the hack was removed in favor of not emitting a <link rel="stylesheet" ...>
tag when running Sourcegraph in local dev.
Merge request reports
Activity
Created by: codecov[bot]
Codecov Report
Merging #5266 into master will increase coverage by
<.01%
. The diff coverage is100%
.@@ Coverage Diff @@ ## master #5266 +/- ## ========================================== + Coverage 45.69% 45.69% +<.01% ========================================== Files 735 735 Lines 45414 45415 +1 Branches 2605 2605 ========================================== + Hits 20751 20754 +3 + Misses 22655 22654 -1 + Partials 2008 2007 -1
Impacted Files Coverage Δ cmd/frontend/internal/app/ui/handlers.go 42.42% <100%> (+0.43%)
...d/frontend/internal/authz/bitbucketserver/store.go 74.01% <0%> (+0.98%)
Created by: sqs
In prod, nothing changes. It extracts all of our SCSS to a .css file and uses a link tag to include it.
In dev, the only change is we no longer have a link tag that loads an empty .css file. It injects the styles into style tags.
We don’t use code splitting on SCSS (all SCSS flies are imported from the entrypoint) so most of your questions are moot. But I’d love to start doing that soon.