Skip to content

Instantly share code, notes, and snippets.

@shakyShane
Created October 10, 2018 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shakyShane/cb45f1584f093ce03948640b07be5631 to your computer and use it in GitHub Desktop.
Save shakyShane/cb45f1584f093ce03948640b07be5631 to your computer and use it in GitHub Desktop.

config-gen

Generate RequireJS Optimizer configuration for Magento 2 website.

Step 1 - Download the binary

config-gen is packaged as a single binary (currently only osx) to enable easy usage, just check the releases page and download the latest.

Step 2 - Run the program against a Magento 2 instance

./config-gen http://example.com 

This will provide you with a new url, something like http://127.0.0.1.

Step 3 - create a configuration file, call it config-gen.yml

presets:
  - name: m2
    options:
      bundle_config: file:test/fixtures/bundle-config.yaml

Step 4 - create the bundle_config noted above.

bundles:
  - name: bundles/main
    urls:
      - "/"
      - "/index.php/women/tops-women/jackets-women.html"
    children:
      - name: bundles/product
        urls:
          - /index.php/juno-jacket.html
        children: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment