The first step in the optimization process is to generate a magepack.config.js file. This is done by running the generate command against a working shop to collect RequireJS dependencies for specific page layouts.
Magepack prepares the following bundles:
cms: Modules for CMS pages.category: Modules for category pages.product: Modules for product pages.checkout: Modules for cart and checkout pages.common: Modules required by all the above bundles.
Required Options:
--cms-url: URL to a CMS page (e.g., homepage).--category-url: URL to a category page.--product-url: URL to a product page.
Note: By default, Magepack will visit the product page, add the product to the cart, and visit both the cart and checkout pages to collect dependencies. Use --skip-checkout to prevent this behavior.
magepack generate --cms-url="{{CMS_PAGE_URL}}" --category-url="{{CATEGORY_PAGE_URL}}" --product-url="{{PRODUCT_PAGE_URL}}"