New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: Do not wrap imports in the identity function un-necessarily #3001
Comments
Yep, I'm also a bit annoyed by this. We will do many optimizations after webpack 2. We want to get to a stable working version before optimizing. The cost is small: |
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
I'd like to keep this open. If someone could give me some pointers to where to start, I might be able find some time for a pr. Spent a while searching but it's really hard to guess the best approach and find the right code to modify. |
@sokra would you be able to help with a where to start? |
Scope Hoisting should eliminate most of these. I'm currently not sure how to solve this. |
Good point. I will check how many of these are left after hoisting. |
This issue had no activity for at least half a year. It's subject to automatic issue closing if there is no activity in the next 15 days. |
Issue was closed because of inactivity. If you think this is still a valid issue, please file a new issue with additional information. |
I'm submitting a feature request
Webpack version:
2.1.0-beta.22
Please tell us about your environment:
Windows 8
Current behavior:
output:
Expected/desired behavior:
becomes
Smaller bundle size, less executed code. Because the function being imported does not reference
this
, it does not need to be wrapped in identity function. Because actually most exported functions will not referencethis
.Further if I have this code
then identity is not added, meaning the exports object is provided to the function when I call it - so that is inconsistent.
The text was updated successfully, but these errors were encountered: