[Tools] Rollup /*#__PURE__*/ tree shaking if not used

const get = /*#__PURE__*/ createGetter();
const readonlyGet = /*#__PURE__*/ createGetter(true);
const shallowGet = /*#__PURE__*/ createGetter(false, true);
const set = /*#__PURE__*/ createSetter();
const shallowSet = /*#__PURE__*/ createSetter(true);

The code marked as /*#__PURE__*/, if rollup has treeshake: true, and we are not using in the production code, then the code will be removed. otherwise not.

posted @ 2025-04-08 00:55  Zhentiw  阅读(10)  评论(0)    收藏  举报