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
1.**File Collection** (`src/file.ts`): Scans source directory recursively using glob, skips pre-compressed files (.gz, .br) if originals exist, detects duplicate files via SHA256 hashing
96
+
1.**File Collection** (`src/file.ts`): Scans source directory recursively using glob, skips pre-compressed files (.gz, .br) if originals exist, filters files matching exclude patterns, detects duplicate files via SHA256 hashing
94
97
2.**Content Analysis** (`src/index.ts`): Determines MIME types using `mime-types` library, calculates MD5 hashes for ETag generation, groups files by extension for statistics
95
98
3.**Compression** (`src/index.ts`): Applies gzip level 9 compression, uses compressed version only when size reduction >15% and original >1024 bytes
96
99
4.**Code Generation** (`src/cppCode.ts`, `src/cppCodeEspIdf.ts`): Uses Handlebars templates with custom helpers (switch/case), generates optimized engine-specific C++ code with:
-**Automatic Gzip Compression**: Compresses assets when size reduction >15% and >1024 bytes
113
116
-**ETag Support**: HTTP cache validation for reduced network traffic with 304 Not Modified responses across all engines (psychic, psychic2, async, espidf)
114
117
-**Cache Control**: Configurable browser caching with `--cachetime`
118
+
-**File Exclusion**: Exclude unwanted files using glob patterns with `--exclude` option
115
119
-**Multi-Engine Support**: Generate code for different ESP web server libraries
116
120
-**File Type Analysis**: Groups files by extension with count statistics
117
121
-**Memory Optimization**: Binary data stored as const arrays in program memory
118
122
-**Optimized C++ Code**: Generated code uses modern C++ best practices with minimal overhead
119
123
124
+
### File Exclusion
125
+
126
+
The tool supports flexible file exclusion using glob patterns to filter out unwanted files from being embedded in the ESP32 firmware.
127
+
128
+
**Pattern Support:**
129
+
130
+
- Simple wildcards: `*.map`, `*.txt`
131
+
- Directory patterns: `test/**/*.js`, `docs/**/*`
132
+
- Specific files: `.DS_Store`, `README.md`
133
+
134
+
**Multiple Patterns:**
135
+
136
+
- Repeated flag: `--exclude *.map --exclude *.md`
137
+
- Comma-separated: `--exclude="*.map,*.md,*.txt"`
138
+
- Combined: Both formats can be mixed
139
+
140
+
**Default Exclusions:**
141
+
System and development files are excluded by default:
142
+
143
+
-`.DS_Store`, `Thumbs.db` (system files)
144
+
-`.git`, `.svn` (version control)
145
+
-`*.swp`, `*~` (editor files)
146
+
-`.gitignore`, `.gitattributes` (git config)
147
+
148
+
**Implementation:**
149
+
150
+
- Uses `picomatch` library (transitive dependency via `tinyglobby`)
151
+
- Filtering occurs after pre-compressed file detection but before file content reading
152
+
- Excluded files are logged with count and list for verification
153
+
- Windows path normalization for cross-platform consistency
Copy file name to clipboardExpand all lines: README.md
+66Lines changed: 66 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -303,6 +303,71 @@ At the same time, it can be an advantage that the content is cached by the brows
303
303
304
304
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.
305
305
306
+
### File Exclusion
307
+
308
+
The `--exclude` option allows you to exclude files from being embedded in the ESP32 firmware using glob patterns. This is useful for excluding source maps, documentation, and test files that shouldn't be part of the deployed application.
0 commit comments