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
I am using TSDX to build my project. In production, when TSDX builds the package, it strips out all unused variables. However, in some cases, it is intentional to have unused variables. For example:
In my TSDX configuration file, I have set the following options:
constcommonjs=require('rollup-plugin-commonjs');constexternal=require('rollup-plugin-peer-deps-external');const{ terser }=require('rollup-plugin-terser');module.exports={rollup(config,opts){config.plugins.push(external(),commonjs(),terser({compress: {// Prevent unused destructured variables from being removedpure_getters: false,unused: false,},}));returnconfig;}};
Current Behavior
In the current build, the props passed to useInput includes customProp because it is stripped out as an unused variable, causing the props object to contain it.
I expect customProp to be still destructured so that the correct props are passed to useInput.
When I manually set the pure_getters option to false or strict in node_modules/tsdx/dist/createRollupConfig.js, the customProp is correctly retained and not stripped out.
Description
I am using TSDX to build my project. In production, when TSDX builds the package, it strips out all unused variables. However, in some cases, it is intentional to have unused variables. For example:
In my TSDX configuration file, I have set the following options:
Current Behavior
In the current build, the props passed to
useInput
includescustomProp
because it is stripped out as an unused variable, causing the props object to contain it.Expected Behavior
I expect
customProp
to be still destructured so that the correct props are passed touseInput
.When I manually set the
pure_getters
option tofalse
orstrict
innode_modules/tsdx/dist/createRollupConfig.js
, thecustomProp
is correctly retained and not stripped out.Your environment
The text was updated successfully, but these errors were encountered: