@jsenv/core 23.9.0 → 24.0.0

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/readme.md CHANGED
@@ -72,8 +72,8 @@ npm install --save-dev @jsenv/core
72
72
  ```js
73
73
  import {
74
74
  executeTestPlan,
75
- chromiumRuntimeTab,
76
- firefoxRuntimeTab,
75
+ chromiumTabRuntime,
76
+ firefoxTabRuntime,
77
77
  } from "@jsenv/core"
78
78
 
79
79
  executeTestPlan({
@@ -81,10 +81,10 @@ executeTestPlan({
81
81
  testPlan: {
82
82
  "./animals.test.html": {
83
83
  chromium: {
84
- runtime: chromiumRuntimeTab,
84
+ runtime: chromiumTabRuntime,
85
85
  },
86
86
  firefox: {
87
- runtime: firefoxRuntimeTab,
87
+ runtime: firefoxTabRuntime,
88
88
  },
89
89
  },
90
90
  },
@@ -140,16 +140,16 @@ npm install --save-dev @jsenv/core
140
140
  2 - Create `start_dev_server.mjs`
141
141
 
142
142
  ```js
143
- import { startExploring } from "@jsenv/core"
143
+ import { startDevServer } from "@jsenv/core"
144
144
 
145
- startExploring({
145
+ startDevServer({
146
146
  projectDirectoryUrl: new URL("./", import.meta.url),
147
147
  explorableConfig: {
148
148
  source: {
149
149
  "**/*.html": true,
150
150
  },
151
151
  },
152
- compileServerPort: 3456,
152
+ port: 3456,
153
153
  })
154
154
  ```
155
155
 
@@ -173,7 +173,7 @@ Browser navigates to `main.html` and execute the file. Hello world is displayed
173
173
 
174
174
  ![dev server hello world screenshot](./docs/demo_exploring_hello_world.png)
175
175
 
176
- To read more about jsenv dev server, also called exploring server, check [jsenv dev server documentation](./docs/exploring/readme.md#jsenv-dev-server).
176
+ To read more about jsenv dev server, check [jsenv dev server documentation](./docs/dev_server/readme.md#jsenv-dev-server).
177
177
 
178
178
  # Build overview
179
179
 
@@ -81,11 +81,11 @@ export const buildProject = async ({
81
81
  serviceWorkerFinalizer,
82
82
 
83
83
  env = {},
84
- compileServerProtocol,
85
- compileServerPrivateKey,
86
- compileServerCertificate,
87
- compileServerIp,
88
- compileServerPort,
84
+ protocol,
85
+ privateKey,
86
+ certificate,
87
+ ip,
88
+ port,
89
89
  jsenvDirectoryRelativeUrl,
90
90
  jsenvDirectoryClean,
91
91
 
@@ -150,7 +150,7 @@ export const buildProject = async ({
150
150
 
151
151
  const compileServer = await startCompileServer({
152
152
  signal: buildOperation.signal,
153
- compileServerLogLevel,
153
+ logLevel: compileServerLogLevel,
154
154
 
155
155
  projectDirectoryUrl,
156
156
  jsenvDirectoryRelativeUrl,
@@ -164,18 +164,18 @@ export const buildProject = async ({
164
164
  moduleOutFormat: "esmodule", // rollup or jsenv rollup plugin will transform into the right format
165
165
  importMetaFormat: "esmodule", // rollup or jsenv rollup plugin will transform into the right format
166
166
 
167
- compileServerProtocol,
168
- compileServerPrivateKey,
169
- compileServerCertificate,
170
- compileServerIp,
171
- compileServerPort,
167
+ protocol,
168
+ privateKey,
169
+ certificate,
170
+ ip,
171
+ port,
172
172
  env,
173
173
  babelPluginMap,
174
174
  transformTopLevelAwait,
175
175
  customCompilers,
176
176
  runtimeSupport,
177
177
 
178
- compileServerCanReadFromFileSystem: filesystemCache,
178
+ compileServerCanReadFromFilesystem: filesystemCache,
179
179
  compileServerCanWriteOnFilesystem: filesystemCache,
180
180
  // keep source html untouched
181
181
  // here we don't need to inline importmap
@@ -3,6 +3,7 @@ import {
3
3
  collectFiles,
4
4
  urlToRelativeUrl,
5
5
  } from "@jsenv/filesystem"
6
+ import { setupRoutes } from "@jsenv/server"
6
7
 
7
8
  import { jsenvCoreDirectoryUrl } from "./internal/jsenvCoreDirectoryUrl.js"
8
9
  import {
@@ -25,12 +26,24 @@ import {
25
26
  } from "./internal/jsenvInternalFiles.js"
26
27
  import { jsenvRuntimeSupportDuringDev } from "./jsenvRuntimeSupportDuringDev.js"
27
28
 
28
- export const startExploring = async ({
29
+ export const startDevServer = async ({
29
30
  signal = new AbortController().signal,
30
31
  handleSIGINT = true,
32
+ port,
33
+ ip,
34
+ protocol,
35
+ http2,
36
+ certificate,
37
+ privateKey,
38
+ plugins,
39
+ customServices,
31
40
 
32
- explorableConfig = jsenvExplorableConfig,
33
41
  projectDirectoryUrl,
42
+ explorableConfig = jsenvExplorableConfig,
43
+ mainFileRelativeUrl = urlToRelativeUrl(
44
+ jsenvExploringIndexHtmlFileInfo.url,
45
+ projectDirectoryUrl,
46
+ ),
34
47
  jsenvDirectoryRelativeUrl,
35
48
  outDirectoryName = "dev",
36
49
  jsenvToolbar = true,
@@ -40,14 +53,9 @@ export const startExploring = async ({
40
53
 
41
54
  babelPluginMap,
42
55
  runtimeSupportDuringDev = jsenvRuntimeSupportDuringDev,
43
- compileServerLogLevel,
56
+ logLevel,
44
57
  compileServerCanReadFromFilesystem,
45
58
  compileServerCanWriteOnFilesystem,
46
- compileServerPort,
47
- compileServerProtocol,
48
- compileServerHttp2,
49
- compileServerCertificate,
50
- compileServerPrivateKey,
51
59
  sourcemapMethod,
52
60
  customCompilers,
53
61
  livereloadWatchConfig,
@@ -65,6 +73,7 @@ export const startExploring = async ({
65
73
  const redirectFiles = createRedirectFilesService({
66
74
  projectDirectoryUrl,
67
75
  outDirectoryRelativeUrl,
76
+ mainFileRelativeUrl,
68
77
  })
69
78
  const serveExploringData = createExploringDataService({
70
79
  projectDirectoryUrl,
@@ -82,28 +91,31 @@ export const startExploring = async ({
82
91
  signal,
83
92
  handleSIGINT,
84
93
  keepProcessAlive,
94
+ logLevel,
95
+ port,
96
+ ip,
97
+ protocol,
98
+ http2,
99
+ certificate,
100
+ privateKey,
101
+ plugins,
102
+ customServices: {
103
+ ...customServices,
104
+ "jsenv:redirector": redirectFiles,
105
+ "jsenv:exploring-data": serveExploringData,
106
+ "jsenv:explorables": serveExplorableListAsJson,
107
+ },
85
108
 
86
109
  projectDirectoryUrl,
87
110
  livereloadSSE: livereloading,
88
111
  jsenvToolbarInjection: jsenvToolbar,
89
- customServices: {
90
- "service:exploring-redirect": (request) => redirectFiles(request),
91
- "service:exploring-data": (request) => serveExploringData(request),
92
- "service:explorables": (request) => serveExplorableListAsJson(request),
93
- },
94
- customCompilers,
95
112
  jsenvDirectoryRelativeUrl,
96
113
  outDirectoryName,
97
114
  inlineImportMapIntoHTML,
98
115
 
99
- compileServerLogLevel,
100
116
  compileServerCanReadFromFilesystem,
101
117
  compileServerCanWriteOnFilesystem,
102
- compileServerPort,
103
- compileServerProtocol,
104
- compileServerHttp2,
105
- compileServerCertificate,
106
- compileServerPrivateKey,
118
+ customCompilers,
107
119
  sourcemapMethod,
108
120
  babelPluginMap,
109
121
  runtimeSupport: runtimeSupportDuringDev,
@@ -114,7 +126,10 @@ export const startExploring = async ({
114
126
  return compileServer
115
127
  }
116
128
 
117
- const createRedirectFilesService = ({ projectDirectoryUrl }) => {
129
+ const createRedirectFilesService = ({
130
+ projectDirectoryUrl,
131
+ mainFileRelativeUrl,
132
+ }) => {
118
133
  const jsenvExploringRedirectorHtmlRelativeUrlForProject = urlToRelativeUrl(
119
134
  jsenvExploringRedirectorHtmlFileInfo.url,
120
135
  projectDirectoryUrl,
@@ -145,18 +160,28 @@ const createRedirectFilesService = ({ projectDirectoryUrl }) => {
145
160
  pathForServer: `/${jsenvToolbarJsBuildRelativeUrlForProject}.map`,
146
161
  }
147
162
 
148
- return (request) => {
149
- // exploring redirection
150
- if (request.ressource === "/") {
151
- const jsenvExploringRedirectorHtmlServerUrl = `${request.origin}/${jsenvExploringRedirectorHtmlRelativeUrlForProject}`
163
+ return setupRoutes({
164
+ "/": (request) => {
165
+ const redirectTarget = mainFileRelativeUrl
166
+ const jsenvExploringRedirectorHtmlServerUrl = `${request.origin}/${jsenvExploringRedirectorHtmlRelativeUrlForProject}?redirect=${redirectTarget}`
152
167
  return {
153
168
  status: 307,
154
169
  headers: {
155
170
  location: jsenvExploringRedirectorHtmlServerUrl,
156
171
  },
157
172
  }
158
- }
159
- if (request.ressource === "/.jsenv/exploring.redirector.js") {
173
+ },
174
+ "/.jsenv/redirect/:rest*": (request) => {
175
+ const redirectTarget = request.ressource.slice("/.jsenv/redirect/".length)
176
+ const jsenvExploringRedirectorHtmlServerUrl = `${request.origin}/${jsenvExploringRedirectorHtmlRelativeUrlForProject}?redirect=${redirectTarget}`
177
+ return {
178
+ status: 307,
179
+ headers: {
180
+ location: jsenvExploringRedirectorHtmlServerUrl,
181
+ },
182
+ }
183
+ },
184
+ "/.jsenv/exploring.redirector.js": (request) => {
160
185
  const jsenvExploringRedirectorBuildServerUrl = `${request.origin}/${jsenvExploringRedirectorJsBuildRelativeUrlForProject}`
161
186
  return {
162
187
  status: 307,
@@ -164,10 +189,8 @@ const createRedirectFilesService = ({ projectDirectoryUrl }) => {
164
189
  location: jsenvExploringRedirectorBuildServerUrl,
165
190
  },
166
191
  }
167
- }
168
-
169
- // exploring index
170
- if (request.ressource === "/.jsenv/exploring.index.js") {
192
+ },
193
+ "/.jsenv/exploring.index.js": (request) => {
171
194
  const jsenvExploringJsBuildServerUrl = `${request.origin}/${jsenvExploringJsBuildRelativeUrlForProject}`
172
195
  return {
173
196
  status: 307,
@@ -175,18 +198,16 @@ const createRedirectFilesService = ({ projectDirectoryUrl }) => {
175
198
  location: jsenvExploringJsBuildServerUrl,
176
199
  },
177
200
  }
178
- }
179
- if (request.ressource === jsenvExploringIndexSourcemapInfo.pathForBrowser) {
201
+ },
202
+ [jsenvExploringIndexSourcemapInfo.pathForBrowser]: (request) => {
180
203
  return {
181
204
  status: 307,
182
205
  headers: {
183
206
  location: `${request.origin}${jsenvExploringIndexSourcemapInfo.pathForServer}`,
184
207
  },
185
208
  }
186
- }
187
-
188
- // toolbar
189
- if (request.ressource === "/.jsenv/toolbar.main.js") {
209
+ },
210
+ "/.jsenv/toolbar.main.js": (request) => {
190
211
  const jsenvToolbarJsBuildServerUrl = `${request.origin}/${jsenvToolbarJsBuildRelativeUrlForProject}`
191
212
  return {
192
213
  status: 307,
@@ -194,18 +215,16 @@ const createRedirectFilesService = ({ projectDirectoryUrl }) => {
194
215
  location: jsenvToolbarJsBuildServerUrl,
195
216
  },
196
217
  }
197
- }
198
- if (request.ressource === jsenvToolbarSourcemapInfo.pathForBrowser) {
218
+ },
219
+ [jsenvToolbarSourcemapInfo.pathForBrowser]: (request) => {
199
220
  return {
200
221
  status: 307,
201
222
  headers: {
202
223
  location: `${request.origin}${jsenvToolbarSourcemapInfo.pathForServer}`,
203
224
  },
204
225
  }
205
- }
206
-
207
- return null
208
- }
226
+ },
227
+ })
209
228
  }
210
229
 
211
230
  const createExploringDataService = ({
package/src/execute.js CHANGED
@@ -39,11 +39,11 @@ export const execute = async ({
39
39
  gracefulStopAllocatedMs,
40
40
  ignoreError = false,
41
41
 
42
- compileServerProtocol,
43
- compileServerPrivateKey,
44
- compileServerCertificate,
45
- compileServerIp,
46
- compileServerPort,
42
+ protocol,
43
+ privateKey,
44
+ certificate,
45
+ ip,
46
+ port,
47
47
  babelPluginMap,
48
48
  customCompilers,
49
49
  compileServerCanReadFromFilesystem,
@@ -94,7 +94,7 @@ export const execute = async ({
94
94
  stop,
95
95
  } = await startCompileServer({
96
96
  signal: executeOperation.signal,
97
- compileServerLogLevel,
97
+ logLevel: compileServerLogLevel,
98
98
 
99
99
  projectDirectoryUrl,
100
100
  jsenvDirectoryRelativeUrl,
@@ -103,11 +103,11 @@ export const execute = async ({
103
103
 
104
104
  importDefaultExtension,
105
105
 
106
- compileServerProtocol,
107
- compileServerPrivateKey,
108
- compileServerCertificate,
109
- compileServerIp,
110
- compileServerPort,
106
+ protocol,
107
+ privateKey,
108
+ certificate,
109
+ ip,
110
+ port,
111
111
  babelPluginMap,
112
112
  customCompilers,
113
113
  runtimeSupport: normalizeRuntimeSupport({
@@ -62,11 +62,11 @@ export const executeTestPlan = async ({
62
62
  // skip full means file with 100% coverage won't appear in coverage reports (log and html)
63
63
  coverageSkipFull = false,
64
64
 
65
- compileServerProtocol,
66
- compileServerPrivateKey,
67
- compileServerCertificate,
68
- compileServerIp,
69
- compileServerPort,
65
+ protocol,
66
+ privateKey,
67
+ certificate,
68
+ ip,
69
+ port,
70
70
  compileServerCanReadFromFilesystem,
71
71
  compileServerCanWriteOnFilesystem,
72
72
  babelPluginMap,
@@ -133,6 +133,7 @@ export const executeTestPlan = async ({
133
133
  handleSIGINT,
134
134
 
135
135
  logger,
136
+ logLevel,
136
137
  compileServerLogLevel,
137
138
  launchAndExecuteLogLevel,
138
139
 
@@ -157,11 +158,11 @@ export const executeTestPlan = async ({
157
158
  coverageTempDirectoryRelativeUrl,
158
159
 
159
160
  jsenvDirectoryClean,
160
- compileServerProtocol,
161
- compileServerPrivateKey,
162
- compileServerCertificate,
163
- compileServerIp,
164
- compileServerPort,
161
+ protocol,
162
+ privateKey,
163
+ certificate,
164
+ ip,
165
+ port,
165
166
  compileServerCanReadFromFilesystem,
166
167
  compileServerCanWriteOnFilesystem,
167
168
  babelPluginMap,
@@ -1,7 +1,7 @@
1
- import { urlToFileSystemPath } from "@jsenv/filesystem"
1
+ import { urlToFileSystemPath, readFile } from "@jsenv/filesystem"
2
2
  import { createDetailedMessage } from "@jsenv/logger"
3
3
  import { timeStart, timeFunction } from "@jsenv/server"
4
- import { readFileContent } from "./fs-optimized-for-cache.js"
4
+
5
5
  import { validateCache } from "./validateCache.js"
6
6
  import { getMetaJsonFileUrl } from "./compile-asset.js"
7
7
  import { createLockRegistry } from "./createLockRegistry.js"
@@ -17,7 +17,6 @@ export const getOrGenerateCompiledFile = async ({
17
17
  compileCacheStrategy,
18
18
  compileCacheSourcesValidation,
19
19
  compileCacheAssetsValidation,
20
- fileContentFallback,
21
20
  request,
22
21
  compile,
23
22
  }) => {
@@ -65,7 +64,6 @@ export const getOrGenerateCompiledFile = async ({
65
64
  originalFileUrl,
66
65
  compiledFileUrl,
67
66
  compile,
68
- fileContentFallback,
69
67
  compileCacheStrategy,
70
68
  compileCacheSourcesValidation,
71
69
  compileCacheAssetsValidation,
@@ -94,7 +92,6 @@ const computeCompileReport = async ({
94
92
  originalFileUrl,
95
93
  compiledFileUrl,
96
94
  compile,
97
- fileContentFallback,
98
95
  compileCacheStrategy,
99
96
  compileCacheSourcesValidation,
100
97
  compileCacheAssetsValidation,
@@ -136,7 +133,6 @@ const computeCompileReport = async ({
136
133
  callCompile({
137
134
  logger,
138
135
  originalFileUrl,
139
- fileContentFallback,
140
136
  compile,
141
137
  }),
142
138
  )
@@ -174,22 +170,11 @@ const computeCompileReport = async ({
174
170
  }
175
171
  }
176
172
 
177
- const callCompile = async ({
178
- logger,
179
- originalFileUrl,
180
- fileContentFallback,
181
- compile,
182
- }) => {
173
+ const callCompile = async ({ logger, originalFileUrl, compile }) => {
183
174
  logger.debug(`compile ${originalFileUrl}`)
184
175
 
185
- const codeBeforeCompile =
186
- compile.length === 0
187
- ? ""
188
- : await getCodeToCompile({ originalFileUrl, fileContentFallback })
189
-
190
176
  const compileReturnValue = await compile({
191
- code: codeBeforeCompile,
192
- map: undefined,
177
+ code: await readFile(originalFileUrl),
193
178
  })
194
179
  if (typeof compileReturnValue !== "object" || compileReturnValue === null) {
195
180
  throw new TypeError(
@@ -229,24 +214,6 @@ const callCompile = async ({
229
214
  }
230
215
  }
231
216
 
232
- const getCodeToCompile = async ({ originalFileUrl, fileContentFallback }) => {
233
- let fileContent
234
- if (fileContentFallback) {
235
- try {
236
- fileContent = await readFileContent(originalFileUrl)
237
- } catch (e) {
238
- if (e.code === "ENOENT") {
239
- fileContent = await fileContentFallback()
240
- } else {
241
- throw e
242
- }
243
- }
244
- } else {
245
- fileContent = await readFileContent(originalFileUrl)
246
- }
247
- return fileContent
248
- }
249
-
250
217
  const startAsap = async (fn, { logger, compiledFileUrl }) => {
251
218
  const metaJsonFileUrl = getMetaJsonFileUrl(compiledFileUrl)
252
219
  const metaJsonFilePath = urlToFileSystemPath(metaJsonFileUrl)
@@ -16,7 +16,6 @@ export const compileFile = async ({
16
16
  projectDirectoryUrl,
17
17
  originalFileUrl,
18
18
  compiledFileUrl,
19
- fileContentFallback,
20
19
  projectFileRequestedCallback = () => {},
21
20
  request,
22
21
  pushResponse,
@@ -44,7 +43,6 @@ export const compileFile = async ({
44
43
  projectDirectoryUrl,
45
44
  originalFileUrl,
46
45
  compiledFileUrl,
47
- fileContentFallback,
48
46
  request,
49
47
  compileCacheStrategy,
50
48
  compileCacheSourcesValidation,
@@ -1,4 +1,4 @@
1
- import { redirectRequest, fetchFileSystem } from "@jsenv/server"
1
+ import { fetchFileSystem } from "@jsenv/server"
2
2
  import {
3
3
  resolveUrl,
4
4
  resolveDirectoryUrl,
@@ -80,7 +80,7 @@ export const createCompiledFileService = ({
80
80
  projectDirectoryUrl,
81
81
  )
82
82
 
83
- return (request, { pushResponse }) => {
83
+ return (request, { pushResponse, redirectRequest }) => {
84
84
  const { origin, ressource } = request
85
85
  // we use "ressourceToPathname" to remove eventual query param from the url
86
86
  // Without this a pattern like "**/*.js" would not match "file.js?t=1"
@@ -167,12 +167,11 @@ export const createCompiledFileService = ({
167
167
  projectFileRequestedCallback,
168
168
  request,
169
169
  pushResponse,
170
- compile: ({ code, map }) => {
170
+ compile: ({ code }) => {
171
171
  return compiler({
172
172
  logger,
173
173
 
174
174
  code,
175
- map,
176
175
  url: originalFileUrl,
177
176
  compiledUrl: compiledFileUrl,
178
177
  projectDirectoryUrl,
@@ -4,7 +4,7 @@ import {
4
4
  startServer,
5
5
  fetchFileSystem,
6
6
  createSSERoom,
7
- composeServicesWithTiming,
7
+ composeServices,
8
8
  urlToContentType,
9
9
  pluginServerTiming,
10
10
  pluginRequestWaitingCheck,
@@ -50,7 +50,15 @@ import { createTransformHtmlSourceFileService } from "./html_source_file_service
50
50
  export const startCompileServer = async ({
51
51
  signal = new AbortController().signal,
52
52
  handleSIGINT,
53
- compileServerLogLevel,
53
+ logLevel,
54
+ protocol = "http",
55
+ http2 = protocol === "https",
56
+ privateKey,
57
+ certificate,
58
+ ip = "0.0.0.0",
59
+ port = 0,
60
+ keepProcessAlive = false,
61
+ onStop = () => {},
54
62
 
55
63
  projectDirectoryUrl,
56
64
 
@@ -82,16 +90,6 @@ export const startCompileServer = async ({
82
90
  babelConfigFileUrl,
83
91
  customCompilers = {},
84
92
 
85
- // options related to the server itself
86
- compileServerProtocol = "http",
87
- compileServerHttp2 = compileServerProtocol === "https",
88
- compileServerPrivateKey,
89
- compileServerCertificate,
90
- compileServerIp = "0.0.0.0",
91
- compileServerPort = 0,
92
- keepProcessAlive = false,
93
- onStop = () => {},
94
-
95
93
  // remaining options
96
94
  runtimeSupport,
97
95
 
@@ -103,6 +101,7 @@ export const startCompileServer = async ({
103
101
  },
104
102
  livereloadLogLevel = "info",
105
103
  customServices = {},
104
+ plugins,
106
105
  livereloadSSE = false,
107
106
  transformHtmlSourceFiles = true,
108
107
  jsenvToolbarInjection = false,
@@ -133,7 +132,7 @@ export const startCompileServer = async ({
133
132
  projectDirectoryUrl,
134
133
  )
135
134
 
136
- const logger = createLogger({ logLevel: compileServerLogLevel })
135
+ const logger = createLogger({ logLevel })
137
136
 
138
137
  const browser = isBrowserPartOfSupportedRuntimes(runtimeSupport)
139
138
  const babelPluginMapFromFile = await loadBabelPluginMapFromFile({
@@ -239,13 +238,14 @@ export const startCompileServer = async ({
239
238
  trackMainAndDependencies: sseSetup.trackMainAndDependencies,
240
239
  })
241
240
  customServices = {
242
- "service:sse": serveSSEForLivereload,
243
241
  ...customServices,
242
+ "service:sse": serveSSEForLivereload,
244
243
  }
245
244
  } else {
246
245
  const roomWhenLivereloadIsDisabled = createSSERoom()
247
246
  roomWhenLivereloadIsDisabled.open()
248
247
  customServices = {
248
+ ...customServices,
249
249
  "service:sse": (request) => {
250
250
  const { accept } = request.headers
251
251
  if (!accept || !accept.includes("text/event-stream")) {
@@ -253,7 +253,6 @@ export const startCompileServer = async ({
253
253
  }
254
254
  return roomWhenLivereloadIsDisabled.join(request)
255
255
  },
256
- ...customServices,
257
256
  }
258
257
  }
259
258
 
@@ -349,15 +348,16 @@ export const startCompileServer = async ({
349
348
  sendServerInternalErrorDetails: true,
350
349
  keepProcessAlive,
351
350
 
352
- logLevel: compileServerLogLevel,
351
+ logLevel,
353
352
 
354
- protocol: compileServerProtocol,
355
- http2: compileServerHttp2,
356
- serverCertificate: compileServerCertificate,
357
- serverCertificatePrivateKey: compileServerPrivateKey,
358
- ip: compileServerIp,
359
- port: compileServerPort,
353
+ protocol,
354
+ http2,
355
+ certificate,
356
+ privateKey,
357
+ ip,
358
+ port,
360
359
  plugins: {
360
+ ...plugins,
361
361
  ...pluginCORS({
362
362
  accessControlAllowRequestOrigin: true,
363
363
  accessControlAllowRequestMethod: true,
@@ -368,12 +368,12 @@ export const startCompileServer = async ({
368
368
  ],
369
369
  accessControlAllowCredentials: true,
370
370
  }),
371
- ...pluginServerTiming,
371
+ ...pluginServerTiming(),
372
372
  ...pluginRequestWaitingCheck({
373
373
  requestWaitingMs: 60 * 1000,
374
374
  }),
375
375
  },
376
- requestToResponse: composeServicesWithTiming({
376
+ requestToResponse: composeServices({
377
377
  ...customServices,
378
378
  ...jsenvServices,
379
379
  }),
@@ -745,7 +745,7 @@ const setupServerSentEventsForLivereload = ({
745
745
  const { referer } = request.headers
746
746
  if (referer) {
747
747
  const { origin } = request
748
- // referer is likely the exploringServer
748
+ // referer is likely the dev server
749
749
  if (referer !== origin && !urlIsInsideOf(referer, origin)) {
750
750
  return {
751
751
  dependency: false,