bertui 1.2.4 → 1.2.5
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/package.json
CHANGED
|
@@ -145,10 +145,10 @@ export async function createDevHandler(options = {}) {
|
|
|
145
145
|
const filepath = join(root, 'node_modules', url.pathname.replace('/node_modules/', ''));
|
|
146
146
|
const file = Bun.file(filepath);
|
|
147
147
|
if (await file.exists()) {
|
|
148
|
-
const ext = extname(filepath).toLowerCase();
|
|
149
148
|
const contentType = ext === '.css' ? 'text/css' :
|
|
150
|
-
|
|
151
|
-
|
|
149
|
+
['.js', '.mjs', '.jsx', '.ts', '.tsx'].includes(ext) ? 'application/javascript; charset=utf-8' :
|
|
150
|
+
ext === '.json' ? 'application/json' :
|
|
151
|
+
getContentType(ext);
|
|
152
152
|
return new Response(file, {
|
|
153
153
|
headers: { 'Content-Type': contentType, 'Cache-Control': 'no-cache' },
|
|
154
154
|
});
|