-
Notifications
You must be signed in to change notification settings - Fork 39
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
#987 optimizing and compressing webpack assets #996
base: master
Are you sure you want to change the base?
#987 optimizing and compressing webpack assets #996
Conversation
@justin0022 @jonespm Thoughts??? |
Thanks for the work. I wouldn't install any alpha modules, 0.4.3 looks like the last released version non-alpha or beta. Maybe create this for a future issue to look at. Good idea on the split, Maybe we can also just ignore changes to the vendors since those files aren't going to change unless we do a full rebuild anyway. This should make the watch run a little faster too. https://webpack.js.org/configuration/watch/#watchoptionsignored |
That's what going on in my mind. The guy who developed SO in prod mode
That did not work The problem I am trying to solve is to load the compressed files in the watch mode, this work only for first couple of times. In watch mode after few JS files changes |
Yeah, I suppose gunicorn is doing that. I'd was planning to to remove the runserver and when PTVSD is enabled it can start up with gunicorn as long as there's only one worker. That would make this a little more consistent. Yeah, I was thinking of some watchOptions like this, but might be related?
|
This post suggest that not to do hashing for generating the js/css etc in development since it will slows down the build. When I don't generate js with hashing it solves 2 problem
The annoyance part every time we need to do a browser cache clean before browser reload.
|
I could achieve optimization for Prod build, but for development on watch mode don't generated hashed zip file after couple of time. I really did not find a solution for this and I don't know if there is solution. More on this issue here I am opening up this for a review, I appreciate any feedback on this |
Here is an overview of what got changed by this pull request: Issues
======
- Added 3
See the complete overview on Codacy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a minor suggestion and a question, see below…
@@ -12,4 +12,5 @@ | |||
<div id="root"></div> | |||
<!-- Webpack rendered JS --> | |||
{% render_bundle 'main' 'js' %} | |||
{% render_bundle 'vendors' 'js' %} | |||
{% endblock %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Add newline to end of file. I know it's not a change made for this PR, but it's an easy thing to catch and correct.
This comment has been minimized.
This comment has been minimized.
I like this change and don't see too many other reviews on this. Can you update the start script conflicts @pushyamig ? |
I forgot what I did with this PR since it has been a long time :) I will update and check back |
Solves #996 , #648Resolves #987
Resolves #648
I was able to split the single JS file to source code + vendor assets and Was able to compress it as. I see issues with compression is implemented.
django-webpack-loader
depends onwebpack-bundle-tracker
index.html
simply changes toThe below screenshot show the download is based on the zipped file size
Webpack in watch mode a change on react code updates both
main
andvendor
mode but compression of the vendor packages doesn't work. I am really not sure why this is the casewebpack-bundle-tracker
a new update is available but it has some breakingwebpack-stats.json
structure that python loader fails to load the json. Either I have to write my own Python loader class to support this as started hereWith version
"webpack-bundle-tracker": "^0.4.3",
anddjango-webpack-loader==0.7.0
things kind of works but upgrading to webpack-bundle-tracker": "1.0.0-alpha.1 " breaks stuff. Need to spend sometime as their documentation is very basic and i have been looking at github issues to understand what exactly going on