use a single Webpack/TypeScript build
Created by: sqs
Previously, there were 2 Webpack and TypeScript builds: in .
and ./enterprise
. This was because these used to live in separate repositories. Now that they are in the same repository, we can combine them. The benefit of combining them is reduced complexity and duplication.
The work to combine the builds consisted of:
- Removing all Webpack/TypeScript build config files from
enterprise/
, such astsconfig.json
,webpack.config.ts
,package.json
, etc. - Rewriting import paths in
enterprise/**/*.ts?(x)
to use relative file paths instead of importing from@sourcegraph/webapp
. - Removing all
dist
-related tasks from the root build config. (These were only used to export a package thatenterprise/
could use in its separate build.)
In combining the builds, some additional changes were required:
- Upgraded Webpack and various Webpack-related packages.
- Switched back to the now-recommended (no longer deprecated) webpack-dev-server from webpack-serve.
- Removed the node-sass-import-once helper because (1) it did not appear to be effective and (2) it resulted in a ModuleNotFoundError when importing a
.css
file in a dependency that itself imported a.css
file with a relative path. (The usual solution for this is to use resolve-url-loader, but that is incompatible with node-sass-import-once. The reason this problem started occurring now is likely due to upgrading sass-loader or related packages, and that was necessitated by other errors that are not worth describing here.) - Remove thread-loader. It did not actually speed up Webpack build times.
This PR does not need to update the CHANGELOG because it is not user facing