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

build: improvements for TS & Webpack #1225

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

pano9000
Copy link
Contributor

Hi,

this PR (still in draft) aims to improve the build process and better utilize TS / Webpack combination

still a little bit work left to do here, but wanted to make this more visible to avoid any "duplicated work", while I work on this.

this prevents tsc from unnecessarily transpiling the frontend part as well:
previously it was transpiled by tsc, but the files got discarded and replaced by the files built by webpack.

speeds up tsc command a bit as well:
from 14 seconds to ~8 secs
output the bundled files directly in the build folder
a) keeps the src folder clean from build output
b) it saves us some "manual" copying work
as per https://webpack.js.org/configuration/devtool/#production

serving the `source-map` file to "normal" users seems to be not recommended, so instead let's go with `nosources-source-map`:

a) this drastically reduces app-dist folder size from 20MB down to 8.7MB
b) it still allows for stack traces
not sure why, but seems like it doesn't like `[jt]s` – which causes it to skip certain .d.ts files, making tsc fail
since we build into the build folder -> we should also clean the folder before building as well

also it makes sense to run tsc first, as it runs faster, so if there's any TS errors, we will have a faster failing build
…inifying

speeds up bundling times __heavily__
@pano9000 pano9000 force-pushed the build_improve-ts-webpack branch from ad7643c to 5e9a33d Compare February 22, 2025 13:16
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.

1 participant