Skip to content
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

Generate `baler-preload-map.json` #3

Open
DrewML opened this issue Aug 20, 2019 · 0 comments
Assignees
Labels

Comments

@DrewML
Copy link
Member

@DrewML DrewML commented Aug 20, 2019

For the Graph Preloading functionality, it's necessary for baler to spit out a mapping of JavaScript dependencies needed per .phtml file.

Requirements

  1. Mapping file should be named baler-preload-map.json, and should be written to the root of a locale dir, as a sibling of requirejs-baler-config.js
  2. A JSON Schema should be provided for Magento_Baler to use for validation
  3. Key/Value should be
    • Key: Path from store root to a .phtml file
    • Value: Array of relative paths to JavaScript files from the require basedir

Example

{
   "vendor/magento/module-example/view/frontend/templates/some-template.phtml": ["path/to/file/1.js", "path/to/file/2.js"],
   "vendor/thirdparty/module-bar/view/frontend/templates/another-template.phtml": ["another/file.js", "yet/another/file/2.js"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.