For my rails app, the webpacker-bundled application.js is already too large (~2M) because of jquery, quill, and some other js dependencies. Currently, I am bundling everything into a single js file, which is loaded by every HTML page. As a result, the page loading time is not acceptable.
So I am thinking of a few methods to fix this problem:
- generate different application.js for different layouts.
- use webpack externals for jquery, quill, and some other dependencies.
Are these the best options? Any suggests?