You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! I'm currently working on improve the build of my library. It is currently created on TS and I developed it for sharing some utilities between other projects of my company.
Now I'm using Webpack 5 and I would like to move it to SWC. After some tests the building is faster and I'm happy with the time but I have a concern with the minify. With Webpack 5 using ts-loader the output is only 175KB, but if I use SWC the output is 253KB, so maybe I'm doing something wrong.
Could anyone help me with some advices?
Here is my .swcrc
.swcrc
{
"$schema": "https://json.schemastore.org/swcrc",
"minify": true,
"jsc": {
"target": "es2016", // Versión de ECMAScript a la que compilar el código
"parser": {
"syntax": "typescript", // Indica que estás utilizando TypeScript,
"tsx": false,
},
"minify": {
"compress": {
"unused": true
},
"mangle": true
}
},
}
And this is the script that I used for building the app.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey! I'm currently working on improve the build of my library. It is currently created on TS and I developed it for sharing some utilities between other projects of my company.
Now I'm using Webpack 5 and I would like to move it to SWC. After some tests the building is faster and I'm happy with the time but I have a concern with the minify. With Webpack 5 using
ts-loader
the output is only 175KB, but if I use SWC the output is 253KB, so maybe I'm doing something wrong.Could anyone help me with some advices?
Here is my .swcrc
.swcrc
And this is the script that I used for building the app.
build.sh
Note: I'm using TSC because I need to create the
.d.ts
filesIn the package.json I have
Thanks in advance! 😄
Beta Was this translation helpful? Give feedback.
All reactions