Generate RequireJS Optimizer configuration for Magento 2 website based on real-world usage.
config-gen
is packaged as a single binary (currently only osx) to enable
easy usage, just check the releases
page and download the latest.
This will provide you with a new url, something like http://127.0.0.1
.
presets:
- name: m2
options:
bundle_config: file:test/fixtures/bundle-config.yml
bundles:
- name: bundles/main
urls:
- "/"
- "/index.php/women/tops-women/jackets-women.html"
children:
- name: bundles/product
urls:
- /index.php/juno-jacket.html
children: []
./config-gen http://example.com --config config-gen.yml
At any point, you can access the following endpoints to retrieve the generated json/js
Path | Purpose |
---|---|
/__bs/build.json | Generates the configuration needed for the Optimzer |
/__bs/loaders.js | Generates the JavaScript needed to load additional bundles |
/__bs/seed.json | Generates a dump of the current state so that you can pick up where you left off |