vanilla-jet 1.5.3 → 1.5.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/framework/router.js +4 -0
- package/package.json +1 -1
- package/test/router.test.js +8 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ All notable project changes are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format follows a structure inspired by Keep a Changelog and semantic versioning.
|
|
6
6
|
|
|
7
|
+
## [1.5.4] - 2026-06-28
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Added missing static MIME types so self-hosted web fonts and icons serve correctly:
|
|
12
|
+
`woff`, `woff2`, `eot`, `ico`. Previously `.woff2`/`.woff` returned 404 (only `ttf` was mapped),
|
|
13
|
+
forcing font fallbacks and wasted requests.
|
|
14
|
+
|
|
7
15
|
## [1.5.3] - 2026-06-28
|
|
8
16
|
|
|
9
17
|
### Changed
|
package/framework/router.js
CHANGED
|
@@ -31,6 +31,10 @@ class Router {
|
|
|
31
31
|
'svg': 'image/svg+xml',
|
|
32
32
|
'ttf': 'application/x-font-ttf',
|
|
33
33
|
'otf': 'application/x-font-opentype',
|
|
34
|
+
'woff': 'font/woff',
|
|
35
|
+
'woff2': 'font/woff2',
|
|
36
|
+
'eot': 'application/vnd.ms-fontobject',
|
|
37
|
+
'ico': 'image/x-icon',
|
|
34
38
|
'pdf': 'application/pdf',
|
|
35
39
|
'json': 'application/json'
|
|
36
40
|
};
|
package/package.json
CHANGED
package/test/router.test.js
CHANGED
|
@@ -48,6 +48,14 @@ test('isProtectedFile: blocks framework/external/node_modules and top-level file
|
|
|
48
48
|
assert.equal(router.isProtectedFile('/public/scripts/vanilla.min.js'), false);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
+
test('mimes: serves common web fonts and icons', () => {
|
|
52
|
+
const router = makeRouter();
|
|
53
|
+
assert.equal(router.mimes['woff2'], 'font/woff2');
|
|
54
|
+
assert.equal(router.mimes['woff'], 'font/woff');
|
|
55
|
+
assert.ok(router.mimes['eot']);
|
|
56
|
+
assert.ok(router.mimes['ico']);
|
|
57
|
+
});
|
|
58
|
+
|
|
51
59
|
test('supportsEncoding: honors q-values and array shape', () => {
|
|
52
60
|
const router = makeRouter();
|
|
53
61
|
assert.equal(router.supportsEncoding(['gzip'], 'gzip'), true);
|