You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+115-2Lines changed: 115 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,10 @@ In order to be able to easily update OTA, it is important - from the users' poin
12
12
13
13
This npm package provides a solution for **inserting any JS client application into the ESP web server** (PsychicHttp and also ESPAsyncWebServer (https://github.com/ESP32Async/ESPAsyncWebServer) and ESP-IDF available, PsychicHttp is the default). For this, JS, html, css, font, assets, etc. files must be converted to binary byte array. Npm mode is easy to use and easy to **integrate into your CI/CD pipeline**.
14
14
15
+
> Starting with version v1.12.0, you can use RC file for configuration
16
+
17
+
> Starting with version v1.11.0, you can exclude files by pattern
18
+
15
19
> Starting with version v1.10.0, we reduced npm dependencies
16
20
17
21
> Starting with version v1.9.0, code generator for esp-idf is available
@@ -84,13 +88,13 @@ npm run fix
84
88
85
89
### Usage
86
90
87
-
**Install package** as devDependency (it is practical if the package is part of the project so that you always receive updates)
91
+
**Install package** as dev dependency (it is practical if the package is part of the project so that you always receive updates)
88
92
89
93
```bash
90
94
npm install -D svelteesp32
91
95
```
92
96
93
-
After a successful Svelte build (rollup/webpack/vite) **create an includeable c++ header** file
97
+
After a successful Svelte build (rollup/webpack/vite) **create an includable c++ header** file
94
98
95
99
```bash
96
100
// for PsychicHttpServer
@@ -425,8 +429,117 @@ You can use the following c++ directives at the project level if you want to con
425
429
|`--version`| Include a version string in generated header, e.g. `--version=v$npm_package_version`| '' |
426
430
|`--espmethod`| Name of generated initialization method |`initSvelteStaticFiles`|
427
431
|`--define`| Prefix of c++ defines (e.g., SVELTEESP32_COUNT) |`SVELTEESP32`|
432
+
|`--config`| Use custom RC file path |`.svelteesp32rc.json`|
428
433
|`-h`| Show help ||
429
434
435
+
### Configuration File
436
+
437
+
You can store frequently-used options in a configuration file to avoid repeating command line arguments. This is especially useful for CI/CD pipelines and team collaboration.
438
+
439
+
#### Quick Start
440
+
441
+
Create `.svelteesp32rc.json` in your project directory:
442
+
443
+
```json
444
+
{
445
+
"engine": "psychic",
446
+
"sourcepath": "./dist",
447
+
"outputfile": "./esp32/include/svelteesp32.h",
448
+
"etag": "true",
449
+
"gzip": "true",
450
+
"cachetime": 86400,
451
+
"exclude": ["*.map", "*.md"]
452
+
}
453
+
```
454
+
455
+
Then simply run:
456
+
457
+
```bash
458
+
npx svelteesp32
459
+
```
460
+
461
+
No command line arguments needed!
462
+
463
+
#### Search Locations
464
+
465
+
The tool automatically searches for `.svelteesp32rc.json` in:
466
+
467
+
1. Current working directory
468
+
2. User home directory
469
+
470
+
Or specify a custom location:
471
+
472
+
```bash
473
+
npx svelteesp32 --config=.svelteesp32rc.prod.json
474
+
```
475
+
476
+
#### Configuration Reference
477
+
478
+
All CLI options can be specified in the RC file using long-form property names:
-**How big a frontend application can be placed?** If you compress the content with gzip, even a 3-4Mb assets directory can be placed. This is a serious enough amount to serve a complete application.
0 commit comments