7
7
To enable easy usage, ` config-gen ` is packaged as a single binary (currently only osx) - just check
8
8
the [ releases] ( https://github.com/shakyShane/config-gen/releases ) page and download the latest version.
9
9
10
- ## Step 2 - create a configuration file, call it ` config-gen.yml `
10
+ To make it executable, run
11
11
12
+ ``` sh
13
+ chmod +x config-gen
12
14
```
15
+
16
+ ** Note** : Some easier installation methods will be released in the coming weeks. :)
17
+
18
+ ## Step 2 - create a configuration file (either ` json ` or ` yaml ` )
19
+
20
+ You can name it anything, but for example, this would be config-gen.yml
21
+
22
+ ``` yml
13
23
presets :
14
24
- name : m2
15
25
options :
16
26
bundle_config : file:test/fixtures/bundle-config.yml
17
27
` ` `
18
28
19
- ## Step 3 - create the ` bundle-config.yml ` file as noted above.
29
+ <details>
30
+ <summary>See <code>.json</code> version</summary><p>
31
+
32
+ {
33
+ "presets": [
34
+ {
35
+ "name": "m2",
36
+ "options": {
37
+ "bundle_config": "file:test/fixtures/bundle-config.json"
38
+ }
39
+ }
40
+ ]
41
+ }
42
+
43
+ </p>
44
+ </details>
45
+
46
+ ## Step 3 - create the ` bundle-config.yml` or `json` file as noted above.
20
47
21
48
This is what determines the parent-child relationship. This file is
22
49
read from disk every time the `/build.json` or `/loaders.js` endpoint is
23
50
requested - which means you can navigate around the site and continue
24
51
to tweak these relationships to get the optimal result.
25
52
26
- ``` yaml
53
+ ` ` ` yml
27
54
bundles:
28
55
- name: "bundles/main"
29
56
urls:
@@ -36,6 +63,33 @@ bundles:
36
63
children: []
37
64
` ` `
38
65
66
+ <details>
67
+ <summary>See <code>.json</code> version</summary><p>
68
+
69
+ {
70
+ " bundles " : [
71
+ {
72
+ " name " : " bundles/main" ,
73
+ " urls " : [
74
+ " /" ,
75
+ " /index.php/women/tops-women/jackets-women.html"
76
+ ],
77
+ " children " : [
78
+ {
79
+ " name " : " bundles/product" ,
80
+ " urls " : [
81
+ " /index.php/juno-jacket.html"
82
+ ],
83
+ " children " : []
84
+ }
85
+ ]
86
+ }
87
+ ]
88
+ }
89
+
90
+ </p>
91
+ </details>
92
+
39
93
# # Step 4 - Now run the program against a Magento 2 instance
40
94
41
95
This will provide you with a new url, something like `http://127.0.0.1`. You should
@@ -85,11 +139,9 @@ exists etc - but I'm not providing a full script here since requirements will di
85
139
## Loading additional bundles
86
140
87
141
When you access `/__bs/loaders.json`, it will provide Javascript snippets that will allow the additional bundles
88
- to be loaded - exactly how you implement this part is up to you, however we will soon be providing a reference
142
+ to be loaded when needed - exactly how you implement this part is up to you, however we will soon be providing a reference
89
143
implementation that shows how to add/remove the additional bundles based on some admin flags.
90
144
91
- For now though, an example should how to load `bundles/default` on every page, would look like this...
92
-
93
145
```html
94
146
<script src="http://example.com/../requirejs/require.js"></script>
95
147
<script src="http://example.com/../mage/requirejs/mixins.js"></script>
0 commit comments