Skip to content

Commit eb7d3c3

Browse files
committedOct 20, 2018
readme: general updates
1 parent 0b9892a commit eb7d3c3

File tree

1 file changed

+58
-6
lines changed

1 file changed

+58
-6
lines changed
 

‎readme.md

+58-6
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,50 @@
77
To enable easy usage, `config-gen` is packaged as a single binary (currently only osx) - just check
88
the [releases](https://github.com/shakyShane/config-gen/releases) page and download the latest version.
99

10-
## Step 2 - create a configuration file, call it `config-gen.yml`
10+
To make it executable, run
1111

12+
```sh
13+
chmod +x config-gen
1214
```
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
1323
presets:
1424
- name: m2
1525
options:
1626
bundle_config: file:test/fixtures/bundle-config.yml
1727
```
1828
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.
2047

2148
This is what determines the parent-child relationship. This file is
2249
read from disk every time the `/build.json` or `/loaders.js` endpoint is
2350
requested - which means you can navigate around the site and continue
2451
to tweak these relationships to get the optimal result.
2552

26-
```yaml
53+
```yml
2754
bundles:
2855
- name: "bundles/main"
2956
urls:
@@ -36,6 +63,33 @@ bundles:
3663
children: []
3764
```
3865

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+
3993
## Step 4 - Now run the program against a Magento 2 instance
4094

4195
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
85139
## Loading additional bundles
86140
87141
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
89143
implementation that shows how to add/remove the additional bundles based on some admin flags.
90144
91-
For now though, an example should how to load `bundles/default` on every page, would look like this...
92-
93145
```html
94146
<script src="http://example.com/../requirejs/require.js"></script>
95147
<script src="http://example.com/../mage/requirejs/mixins.js"></script>

0 commit comments

Comments
 (0)
Please sign in to comment.