@jsenv/core 23.8.4 → 23.8.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/core",
3
- "version": "23.8.4",
3
+ "version": "23.8.6",
4
4
  "description": "Tool to develop, test and build js projects",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -70,7 +70,7 @@
70
70
  "@jsenv/importmap": "1.1.0",
71
71
  "@jsenv/log": "1.4.0",
72
72
  "@jsenv/logger": "4.0.1",
73
- "@jsenv/server": "10.0.9",
73
+ "@jsenv/server": "10.0.11",
74
74
  "@jsenv/uneval": "1.6.0",
75
75
  "@jsenv/workers": "1.2.0",
76
76
  "@rollup/plugin-commonjs": "21.0.0",
@@ -88,7 +88,9 @@ export const compileFile = async ({
88
88
  } = compileResult
89
89
 
90
90
  if (compileResultStatus !== "cached" && compileCacheStrategy !== "none") {
91
- updateMeta({
91
+ // we MUST await updateMeta otherwise we might get 404
92
+ // when serving sourcemap files
93
+ await updateMeta({
92
94
  logger,
93
95
  meta,
94
96
  compileResult,
@@ -142,6 +144,7 @@ export const compileFile = async ({
142
144
  headers: {
143
145
  "content-length": Buffer.byteLength(compiledSource),
144
146
  "content-type": contentType,
147
+ "cache-control": "no-store",
145
148
  ...responseHeaders,
146
149
  },
147
150
  body: compiledSource,
@@ -158,12 +161,16 @@ export const compileFile = async ({
158
161
  ) {
159
162
  return {
160
163
  status: 304,
164
+ headers: {
165
+ "cache-control": "private,max-age=0,must-revalidate",
166
+ },
161
167
  timing,
162
168
  }
163
169
  }
164
170
  return respondUsingRAM((response) => {
165
171
  // eslint-disable-next-line dot-notation
166
172
  response.headers["etag"] = compiledEtag
173
+ response.headers["cache-control"] = "private,max-age=0,must-revalidate"
167
174
  })
168
175
  }
169
176
 
@@ -174,6 +181,9 @@ export const compileFile = async ({
174
181
  ) {
175
182
  return {
176
183
  status: 304,
184
+ headers: {
185
+ "cache-control": "private,max-age=0,must-revalidate",
186
+ },
177
187
  timing,
178
188
  }
179
189
  }
@@ -181,6 +191,7 @@ export const compileFile = async ({
181
191
  response.headers["last-modified"] = new Date(
182
192
  compiledMtime,
183
193
  ).toUTCString()
194
+ response.headers["cache-control"] = "private,max-age=0,must-revalidate"
184
195
  })
185
196
  }
186
197