The CJS output is a bit large when building the library #442
Replies: 3 comments 3 replies
-
Can not reproduce it. And you should specify
Excluding the time consumed by DTS files generation:
The time consumed by DTS files generation is just the time consumed by tsc execution, which takes a very long time, so the overall build time consumption is not significantly improved. In addition, since the generated DTS file of tsup is bundle DTS implemented by rollup-plugin-dts, the structure and time consumption is different from which of Rslib do that generate bundleless DTS by Typescirpt compiler API. And we are exploring a fast type generation solution based on isolated declarations. |
Beta Was this translation helpful? Give feedback.
-
之所以感觉没有速度上的提升,主要是在
|
Beta Was this translation helpful? Give feedback.
-
反复多次执行
|
Beta Was this translation helpful? Give feedback.
-
When building AutoStore, the output sizes of the
cjs
andesm
products were compared to those generated bytsup
. The results are as follows:tsup
Output:The sizes of the
cjs
andesm
outputs are similar, but there is a significant difference in the output sizes ofrslib
:rslib
Output:cjs
andesm
outputs fromrslib
are 65 KB and 53 KB, respectively, with thecjs
output being nearly 9.8 KB larger than theesm
output.tsup
is run beforerslib
, the second build attempt will result in an error.tsup
.You can find the reproducible project here.
在构建AutoStore时,输出
cjs
和esm
产物,对比tsup
的产物大小对比如下:tsup
产物如下:cjs
和esm
产物大小基本一致,但是rslib
的产物则差距较大:rslib
产物如下:rslib
的cjs
和esm
产物分别是65K
和53K
,cjs
产物比esm
大了近9.8K
。tsup
构建后再调用rslib
构建时,第二次调用时会构建出错。tsup
并没有提升的样子以上重现工程在这里
Beta Was this translation helpful? Give feedback.
All reactions