-
Notifications
You must be signed in to change notification settings - Fork 103
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
Not as optimized for Webpack as it could be #7
Comments
Example input and output: https://gist.github.com/vigneshshanmugam/89867ac713d1160c865c53c93e47470a |
Did we test these w/ the V8LazyParseWebpackPlugin? |
@TheLarkInn if I had some guidance on moving to Webpack 2, I would try it out. |
That plugin may work with webpack 1 also, but what specifically do you need help with for webpack 2. |
This may be a good first patch, given that you basically just need to add a new test case ( |
@TheLarkInn Does lazyparseplugin adds the parans for the modules in array? |
It sure does!! If you have a large app feel free to try it. Only catch is that I believe you have to tell UglifyJsPlugin compress option to set |
@vigneshshanmugam if you have an app that we can test with I'd be interested to see the statistics. |
@TheLarkInn I tried it and updated the gist. It fails to wrap the inner functions as well. Also updated the readme here - TheLarkInn/LazyParseWebpackPlugin#4 |
Awesome!!! I intentionally didn't wrap the inner functions inside modules because I wasn't sure the benefit, but it's definitely possible to use a webpack parser plugin to do this. |
Ahh got it.. But i believe the benchmarks in the README includes the wrapping for inner functions as well.. Anyways as you said, its possible to do this :) |
…dds ability to wrap functions that are elements of an array literal in an argument list
* Fix for #7: Not as optimized for Webpack as it could be. Adds ability to wrap functions that are elements of an array literal in an argument list * Added a few negative case tests in response to code review. * Modified the array literal logic to very specifically track with webpack patterns rather than all array literal function parameters.
Fixed in #33 |
* Fix for #7: Not as optimized for Webpack as it could be. Adds ability to wrap functions that are elements of an array literal in an argument list * Added a few negative case tests in response to code review. * Modified the array literal logic to very specifically track with webpack patterns rather than all array literal function parameters. * Added optimization of browserify modules. * Refactor of browserify and webpack logic.
Looking at the Webpack output, it appears to me that those modules that are passed in as an array to another function (and are therefore not wrapped) should probably be wrapped. As with Browserify, I'd wager it's rare for a module not to be immediately
require()
d, meaning that wrapping all of them would provide a perf boost.Need a reasonably-sized Webpack bundle in order to test this and confirm, though. TODO: find some large-ish library that is built with Webpack.
The text was updated successfully, but these errors were encountered: