-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add JS bundling and minification with Rollup #48
base: main
Are you sure you want to change the base?
Conversation
Hello, I'm Franklin Bot and I will run some test suites that validate the page speed.
|
|
'./scripts/scripts.js', | ||
// is already imported by script.js. | ||
// There is no need to generate a bundle for it (ignoring 404.html) | ||
// './scripts/lib-franklin.js', |
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.
The issue with creating two bundles for both scripts.js and lib-franking.js was that they have some common dependencies, and rollup tried to extract these to guarantee that both bundles can run standalone without any duplicate code being loaded. but currently scripts and franklin were loaded on every page, (webpack has an option for this: https://webpack.js.org/concepts/entry-points/#entrydescription-object but i didn't find something similar for rollup) and i wanted to have less number of requests as possible to test its effect. so i removed the script tag for franklin. the code is being imported by scripts.js anyways.
add source map outputs for better debugging
|
add npm script to run the hlx dev server and rollup in watch mode for local devlopment
add pre-commit hook to build and add js artefacts to the commit
|
Add rollup for bundling and minification of javascript files. To reduce the number of requests and the response size and achieve a slightly better load performance.
Test URLs: