@michijs/dev-server 0.8.1-beta.5 → 0.8.1-beta.6

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.
@@ -26,13 +26,19 @@ export const start = async (callback) => {
26
26
  const proxyReq = http.request(esbuildProxyRequestOptions, (proxyRes) => {
27
27
  // If esbuild returns "not found", send a custom 404 page
28
28
  if (!proxyRes.statusCode || proxyRes.statusCode === 404) {
29
- res.writeHead(200, { "Content-Type": "text/html", ...config.aditionalHeaders });
29
+ res.writeHead(200, {
30
+ "Content-Type": "text/html",
31
+ ...config.aditionalHeaders,
32
+ });
30
33
  // TODO: Find a better way to do this
31
34
  res.end(fs.readFileSync(getPath(`${config.esbuildOptions.outdir}/${config.public.indexName}`)));
32
35
  return;
33
36
  }
34
37
  // Otherwise, forward the response from esbuild to the client
35
- res.writeHead(proxyRes.statusCode, { ...proxyRes.headers, ...config.aditionalHeaders });
38
+ res.writeHead(proxyRes.statusCode, {
39
+ ...proxyRes.headers,
40
+ ...config.aditionalHeaders,
41
+ });
36
42
  proxyRes.pipe(res, { end: true });
37
43
  });
38
44
  // Forward the body of the request to esbuild
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@michijs/dev-server",
3
3
  "license": "MIT",
4
- "version": "0.8.1-beta.5",
4
+ "version": "0.8.1-beta.6",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/michijs/dev-server.git"