I’m submitting a feature request
Webpack version:
2.x
Current behavior:
Single entry bundle still contain all the boilerplate for require components, not needed (?) when everything is one file
Expected/desired behavior:
A smaller bundle size since the webpack__require
and friends can be omitted(?)
We have this listed in our 2.4 milestone. Milestone we are on right now is 2.3. We have more PR’s to land in master for perf, refactor, and then we start 2.4 which will contain our first feature from the voting list. 2.3 was added to ensure that we are not leaving behind any issues from dropping 2.2.
Wondering if this is still in the works? I know that scope hoisting is now done, but it seems like single-bundle files still contain a fair amount of unnecessary boilerplate. For example, an entrypoint containing the one-liner
document.body.focus()
produces this output (without -p):and with
-p
:As you can see, in both cases there seems to be additional code in the output bundle relating to ES modules and exports.