Webpack will generate this code
import { useState } from 'react';
useState(0);
into this code
(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);
// which can be later minified into this code
// (0,a.b)(0);
I have hundreds of imports in my application and each time Webpack add’s 4 extra symbols. I know that Webpack tries to make ‘this’ equal to ‘undefined’ this way. All the libraries I use don’t use ‘this’ keyword in the exported functions.
// Is it possible to make webpack generate this code
react__WEBPACK_IMPORTED_MODULE_0__.useState(0);
// instead of this?
(0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(0);