Remove unused javascript code based on coverage report

后端 未结 6 695
北海茫月
北海茫月 2021-02-05 07:45

There is a big javascript library (~ 40 000 lines of code) and an application which uses less than 50% of the library\'s code.

There is a test which uti

6条回答
  •  死守一世寂寞
    2021-02-05 08:02

    There are two techniques to eliminate dead code and it is possible using javascript build systems- webpack.

    1. Dead code elimination (DCE) : compiler optimisation- It excludes which is not needed in the program.

    2. Tree Shaking It works in reverse direction, includes only what is actually needed in the program.

    Click here for detailed configuration.

提交回复
热议问题