Skip to content

Commit dcba9dd

Browse files
committed
fix: readme
1 parent c7e323b commit dcba9dd

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ This npm package provides a solution for **inserting any JS client application i
1616
1717
> Starting with version v1.3.0, c++ defines can be used.
1818
19+
> Version v1.4.0 has a breaking change! --no-gzip changed to --gzip. Starting with this version c++ compiler directives are available to setup operation in project level.
20+
1921
### Usage
2022

2123
**Install package** as devDependency (it is practical if the package is part of the project so that you always receive updates)
@@ -160,7 +162,10 @@ All modern browsers have been able to handle gzip-compressed content for years.
160162

161163
During the translation process, data in gzip format is generated and will be used if the **size is greater than 100 bytes** and we experience a **reduction of at least 15%**. In such a case, the compressed data is unconditionally sent to the browser with the appropriate **Content-Encoding** header information.
162164

163-
Automatic compression can be turned off with the `--no-gzip` option.
165+
Automatic compression can be turned off with the `--gzip=false` option.
166+
167+
> This setting has three states: yes, no, and compiler mode is available. In compiler mode, you can disable/enable Gzip by setting the `SVELTEESP32_ENABLE_GZIP` c++ compiler directive.
168+
> For example, if using platformio, you can use `-D SVELTEESP32_ENABLE_GZIP`.
164169
165170
### ETag
166171

@@ -170,6 +175,9 @@ Since microcontroller data traffic is moderately expensive, it is an individual
170175

171176
The use of ETag is **not enabled by default**, this can be achieved with the `--etag=true` switch.
172177

178+
> This setting has three states: yes, no, and compiler mode is available. In compiler mode, you can disable/enable ETag by setting the `SVELTEESP32_ENABLE_ETAG` c++ compiler directive.
179+
> For example, if using platformio, you can use `-D SVELTEESP32_ENABLE_ETAG`.
180+
173181
### Main entry point - index.html
174182

175183
Typically, the entry point for web applications is the **index.htm or index.html** file. This does not need to be listed in the browser's address bar because web servers know that this file should be served by default. Svelteesp32 also does this: if there is an index.htm or index.html file, it sets it as the main file to be served. So using `http://esp_xxx.local` or just entering the `http://x.y.w.z/` IP address will serve this main file.
@@ -214,6 +222,9 @@ You can include a blocker error if a named file accidentally missing from the bu
214222
...
215223
```
216224

225+
You can use the following c++ directives at the project level if you want to configure the usage there. Do not forget `--etag=compiler` or `--gzip=compiler` command line arg:
226+
`SVELTEESP32_ENABLE_ETAG` and `SVELTEESP32_ENABLE_GZIP`
227+
217228
### Command line options
218229

219230
| Option | Description | default |
@@ -222,7 +233,7 @@ You can include a blocker error if a named file accidentally missing from the bu
222233
| `-e` | The engine for which the include file is created (psychic/async) | psychic |
223234
| `-o` | Generated output file with path | `svelteesp32.h` |
224235
| `--etag` | Use ETag header for cache (true/false/compiler) | false |
225-
| `--no-gzip` | Do not compress content with gzip | false -> gzip used |
236+
| `--gzip` | Compress content with gzip (true/false/compiler) | true |
226237
| `--espmethod` | Name of generated method | `initSvelteStaticFiles` |
227238
| `--define` | Prefix of c++ defines | `SVELTEESP32` |
228239
| `-h` | Show help | |

0 commit comments

Comments
 (0)