webpack-dev-service 0.15.8 → 0.15.10
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/cjs/client/client.cjs +1 -1
- package/cjs/client/events.cjs +1 -1
- package/cjs/client/hot.cjs +1 -1
- package/cjs/client/index.cjs +1 -1
- package/cjs/client/main.cjs +1 -1
- package/cjs/client/ui/Overlay.cjs +1 -1
- package/cjs/client/ui/Progress.cjs +1 -1
- package/cjs/client/ui/images/webpack-logo.svg.cjs +1 -1
- package/cjs/client/ui/utils.cjs +1 -1
- package/cjs/server/compose.cjs +1 -1
- package/cjs/server/dev/ReadStream.cjs +5 -5
- package/cjs/server/dev/ReadStream.d.cts +3 -2
- package/cjs/server/dev/Service.cjs +19 -26
- package/cjs/server/dev/Service.d.cts +9 -7
- package/cjs/server/dev/index.cjs +1 -1
- package/cjs/server/dev/middleware.cjs +1 -1
- package/cjs/server/dev/utils/fs.cjs +1 -1
- package/cjs/server/dev/utils/hash.cjs +1 -1
- package/cjs/server/dev/utils/http.cjs +1 -1
- package/cjs/server/dev/utils/path.cjs +1 -1
- package/cjs/server/dev/utils/paths.cjs +1 -1
- package/cjs/server/dev/utils/ready.cjs +1 -1
- package/cjs/server/dev/utils/setupHooks.cjs +1 -1
- package/cjs/server/dev/utils/setupOutputFileSystem.cjs +1 -1
- package/cjs/server/dev/utils/setupWatching.cjs +1 -1
- package/cjs/server/dev/utils/setupWriteToDisk.cjs +1 -1
- package/cjs/server/hot/Socket.cjs +1 -1
- package/cjs/server/hot/index.cjs +1 -1
- package/cjs/server/hot/utils.cjs +1 -1
- package/cjs/server/index.cjs +1 -1
- package/cjs/server/schema.cjs +1 -1
- package/cjs/server/utils.cjs +1 -1
- package/esm/client/client.js +1 -1
- package/esm/client/events.js +1 -1
- package/esm/client/hot.js +1 -1
- package/esm/client/index.js +1 -1
- package/esm/client/main.js +1 -1
- package/esm/client/ui/Overlay.js +1 -1
- package/esm/client/ui/Progress.js +1 -1
- package/esm/client/ui/images/webpack-logo.svg.js +1 -1
- package/esm/client/ui/utils.js +1 -1
- package/esm/server/compose.js +1 -1
- package/esm/server/dev/ReadStream.d.ts +3 -2
- package/esm/server/dev/ReadStream.js +5 -5
- package/esm/server/dev/Service.d.ts +9 -7
- package/esm/server/dev/Service.js +19 -26
- package/esm/server/dev/index.js +1 -1
- package/esm/server/dev/middleware.js +1 -1
- package/esm/server/dev/utils/fs.js +1 -1
- package/esm/server/dev/utils/hash.js +1 -1
- package/esm/server/dev/utils/http.js +1 -1
- package/esm/server/dev/utils/path.js +1 -1
- package/esm/server/dev/utils/paths.js +1 -1
- package/esm/server/dev/utils/ready.js +1 -1
- package/esm/server/dev/utils/setupHooks.js +1 -1
- package/esm/server/dev/utils/setupOutputFileSystem.js +1 -1
- package/esm/server/dev/utils/setupWatching.js +1 -1
- package/esm/server/dev/utils/setupWriteToDisk.js +1 -1
- package/esm/server/hot/Socket.js +1 -1
- package/esm/server/hot/index.js +1 -1
- package/esm/server/hot/utils.js +1 -1
- package/esm/server/index.js +1 -1
- package/esm/server/schema.js +1 -1
- package/esm/server/utils.js +1 -1
- package/package.json +14 -14
package/cjs/client/client.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/cjs/client/events.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/cjs/client/hot.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/cjs/client/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/cjs/client/main.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/cjs/client/ui/utils.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/cjs/server/compose.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -131,13 +131,13 @@ class ReadStream extends node_stream.Readable {
|
|
|
131
131
|
const buffer = node_buffer.Buffer.allocUnsafeSlow(bytesToRead);
|
|
132
132
|
const position = range.offset + bytesRead;
|
|
133
133
|
// Read file range.
|
|
134
|
-
this.#fs.read(fd, buffer, 0, bytesToRead, position, (
|
|
134
|
+
this.#fs.read(fd, buffer, 0, bytesToRead, position, (readError, bytesRead, buffer) => {
|
|
135
135
|
this.#reading = false;
|
|
136
136
|
// Tell ._destroy() that it's safe to close the fd now.
|
|
137
137
|
if (this.destroyed) {
|
|
138
|
-
this.emit(DISPOSE_EVENT,
|
|
139
|
-
} else if (
|
|
140
|
-
this.destroy(
|
|
138
|
+
this.emit(DISPOSE_EVENT, readError);
|
|
139
|
+
} else if (readError != null) {
|
|
140
|
+
this.destroy(readError);
|
|
141
141
|
} else if (bytesRead !== bytesToRead) {
|
|
142
142
|
this.destroy(new RangeError('invalid read operation'));
|
|
143
143
|
} else {
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { PathLike } from 'node:fs';
|
|
5
5
|
import { Range } from './utils/http.cjs';
|
|
6
|
+
import { Readable } from 'node:stream';
|
|
6
7
|
import { FileSystem } from './utils/fs.cjs';
|
|
7
|
-
|
|
8
|
-
export interface Options extends Pick<ReadableOptions, 'highWaterMark'> {
|
|
8
|
+
export interface Options {
|
|
9
9
|
fs: FileSystem;
|
|
10
|
+
highWaterMark?: number;
|
|
10
11
|
}
|
|
11
12
|
interface Callback {
|
|
12
13
|
(error?: Error | null): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -39,18 +39,14 @@ class Service {
|
|
|
39
39
|
* @param options The file service options.
|
|
40
40
|
*/
|
|
41
41
|
constructor(root, options) {
|
|
42
|
-
this.#options = options;
|
|
43
42
|
this.#root = path.unixify(node_path.resolve(root));
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
#isIgnore(path) {
|
|
52
|
-
const { ignore } = this.#options;
|
|
53
|
-
return (utils.isFunction(ignore) ? ignore(path) : false) === true;
|
|
43
|
+
const { ignore, headers, highWaterMark = 65536 } = options;
|
|
44
|
+
this.#options = {
|
|
45
|
+
...options,
|
|
46
|
+
ignore: utils.isFunction(ignore) ? ignore : () => false,
|
|
47
|
+
headers: utils.isFunction(headers) ? headers : () => headers,
|
|
48
|
+
highWaterMark: utils.isFunction(highWaterMark) ? highWaterMark : () => highWaterMark
|
|
49
|
+
};
|
|
54
50
|
}
|
|
55
51
|
/**
|
|
56
52
|
* @private
|
|
@@ -62,21 +58,15 @@ class Service {
|
|
|
62
58
|
*/
|
|
63
59
|
async #setupHeaders({ response }, path, stats) {
|
|
64
60
|
const options = this.#options;
|
|
65
|
-
const { headers } = options;
|
|
66
61
|
// Set status.
|
|
67
62
|
response.status = 200;
|
|
68
63
|
// Set Content-Type.
|
|
69
64
|
response.type = node_path.extname(path);
|
|
70
|
-
//
|
|
65
|
+
// Get headers.
|
|
66
|
+
const headers = await options.headers(path, stats);
|
|
67
|
+
// If headers not empty, set headers.
|
|
71
68
|
if (headers) {
|
|
72
|
-
|
|
73
|
-
const fields = await headers(path, stats);
|
|
74
|
-
if (fields) {
|
|
75
|
-
response.set(fields);
|
|
76
|
-
}
|
|
77
|
-
} else {
|
|
78
|
-
response.set(headers);
|
|
79
|
-
}
|
|
69
|
+
response.set(headers);
|
|
80
70
|
}
|
|
81
71
|
// Accept-Ranges.
|
|
82
72
|
if (options.acceptRanges === false) {
|
|
@@ -128,12 +118,12 @@ class Service {
|
|
|
128
118
|
if (path.isOutRoot(path$1, root)) {
|
|
129
119
|
return false;
|
|
130
120
|
}
|
|
121
|
+
// Get options.
|
|
122
|
+
const options = this.#options;
|
|
131
123
|
// Is ignore path or file (403).
|
|
132
|
-
if (
|
|
124
|
+
if (await options.ignore(path$1)) {
|
|
133
125
|
return false;
|
|
134
126
|
}
|
|
135
|
-
// Get options.
|
|
136
|
-
const options = this.#options;
|
|
137
127
|
// File stats.
|
|
138
128
|
const stats = await fs.stat(options.fs, path$1);
|
|
139
129
|
// Check file stats.
|
|
@@ -190,7 +180,10 @@ class Service {
|
|
|
190
180
|
return context.throw(400);
|
|
191
181
|
}
|
|
192
182
|
// Set response body.
|
|
193
|
-
response.body = new ReadStream.ReadStream(path$1, ranges,
|
|
183
|
+
response.body = new ReadStream.ReadStream(path$1, ranges, {
|
|
184
|
+
fs: options.fs,
|
|
185
|
+
highWaterMark: await options.highWaterMark(path$1, stats)
|
|
186
|
+
});
|
|
194
187
|
// File found.
|
|
195
188
|
return true;
|
|
196
189
|
}
|
|
@@ -4,24 +4,26 @@
|
|
|
4
4
|
import { Context } from 'koa';
|
|
5
5
|
import { Stats } from 'node:fs';
|
|
6
6
|
import { FileSystem } from './utils/fs.cjs';
|
|
7
|
-
interface IgnoreFunction {
|
|
8
|
-
(path: string): boolean;
|
|
9
|
-
}
|
|
10
7
|
interface Headers {
|
|
11
8
|
[key: string]: string | string[];
|
|
12
9
|
}
|
|
13
|
-
|
|
10
|
+
interface IgnoreFunction {
|
|
11
|
+
(path: string): Promise<boolean> | boolean;
|
|
12
|
+
}
|
|
13
|
+
interface HighWaterMarkFunction {
|
|
14
|
+
(path: string, stats: Stats): Promise<number> | number;
|
|
15
|
+
}
|
|
14
16
|
interface HeadersFunction {
|
|
15
|
-
(path: string, stats:
|
|
17
|
+
(path: string, stats: Stats): Promise<Headers | void> | Headers | void;
|
|
16
18
|
}
|
|
17
19
|
export interface Options {
|
|
18
|
-
fs: FileSystem;
|
|
19
20
|
etag?: boolean;
|
|
21
|
+
fs: FileSystem;
|
|
20
22
|
acceptRanges?: boolean;
|
|
21
23
|
lastModified?: boolean;
|
|
22
|
-
highWaterMark?: number;
|
|
23
24
|
ignore?: IgnoreFunction;
|
|
24
25
|
headers?: Headers | HeadersFunction;
|
|
26
|
+
highWaterMark?: number | HighWaterMarkFunction;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* @class Service
|
package/cjs/server/dev/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/cjs/server/hot/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/cjs/server/hot/utils.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/cjs/server/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/cjs/server/schema.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/cjs/server/utils.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/client/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/client/events.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/client/hot.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/client/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/client/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/client/ui/Overlay.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/client/ui/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/server/compose.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { PathLike } from 'node:fs';
|
|
5
5
|
import { Range } from './utils/http.js';
|
|
6
|
+
import { Readable } from 'node:stream';
|
|
6
7
|
import { FileSystem } from './utils/fs.js';
|
|
7
|
-
|
|
8
|
-
export interface Options extends Pick<ReadableOptions, 'highWaterMark'> {
|
|
8
|
+
export interface Options {
|
|
9
9
|
fs: FileSystem;
|
|
10
|
+
highWaterMark?: number;
|
|
10
11
|
}
|
|
11
12
|
interface Callback {
|
|
12
13
|
(error?: Error | null): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -129,13 +129,13 @@ class ReadStream extends Readable {
|
|
|
129
129
|
const buffer = Buffer.allocUnsafeSlow(bytesToRead);
|
|
130
130
|
const position = range.offset + bytesRead;
|
|
131
131
|
// Read file range.
|
|
132
|
-
this.#fs.read(fd, buffer, 0, bytesToRead, position, (
|
|
132
|
+
this.#fs.read(fd, buffer, 0, bytesToRead, position, (readError, bytesRead, buffer) => {
|
|
133
133
|
this.#reading = false;
|
|
134
134
|
// Tell ._destroy() that it's safe to close the fd now.
|
|
135
135
|
if (this.destroyed) {
|
|
136
|
-
this.emit(DISPOSE_EVENT,
|
|
137
|
-
} else if (
|
|
138
|
-
this.destroy(
|
|
136
|
+
this.emit(DISPOSE_EVENT, readError);
|
|
137
|
+
} else if (readError != null) {
|
|
138
|
+
this.destroy(readError);
|
|
139
139
|
} else if (bytesRead !== bytesToRead) {
|
|
140
140
|
this.destroy(new RangeError('invalid read operation'));
|
|
141
141
|
} else {
|
|
@@ -4,24 +4,26 @@
|
|
|
4
4
|
import { Context } from 'koa';
|
|
5
5
|
import { Stats } from 'node:fs';
|
|
6
6
|
import { FileSystem } from './utils/fs.js';
|
|
7
|
-
interface IgnoreFunction {
|
|
8
|
-
(path: string): boolean;
|
|
9
|
-
}
|
|
10
7
|
interface Headers {
|
|
11
8
|
[key: string]: string | string[];
|
|
12
9
|
}
|
|
13
|
-
|
|
10
|
+
interface IgnoreFunction {
|
|
11
|
+
(path: string): Promise<boolean> | boolean;
|
|
12
|
+
}
|
|
13
|
+
interface HighWaterMarkFunction {
|
|
14
|
+
(path: string, stats: Stats): Promise<number> | number;
|
|
15
|
+
}
|
|
14
16
|
interface HeadersFunction {
|
|
15
|
-
(path: string, stats:
|
|
17
|
+
(path: string, stats: Stats): Promise<Headers | void> | Headers | void;
|
|
16
18
|
}
|
|
17
19
|
export interface Options {
|
|
18
|
-
fs: FileSystem;
|
|
19
20
|
etag?: boolean;
|
|
21
|
+
fs: FileSystem;
|
|
20
22
|
acceptRanges?: boolean;
|
|
21
23
|
lastModified?: boolean;
|
|
22
|
-
highWaterMark?: number;
|
|
23
24
|
ignore?: IgnoreFunction;
|
|
24
25
|
headers?: Headers | HeadersFunction;
|
|
26
|
+
highWaterMark?: number | HighWaterMarkFunction;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* @class Service
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -31,18 +31,14 @@ class Service {
|
|
|
31
31
|
* @param options The file service options.
|
|
32
32
|
*/
|
|
33
33
|
constructor(root, options) {
|
|
34
|
-
this.#options = options;
|
|
35
34
|
this.#root = unixify(resolve(root));
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
#isIgnore(path) {
|
|
44
|
-
const { ignore } = this.#options;
|
|
45
|
-
return (isFunction(ignore) ? ignore(path) : false) === true;
|
|
35
|
+
const { ignore, headers, highWaterMark = 65536 } = options;
|
|
36
|
+
this.#options = {
|
|
37
|
+
...options,
|
|
38
|
+
ignore: isFunction(ignore) ? ignore : () => false,
|
|
39
|
+
headers: isFunction(headers) ? headers : () => headers,
|
|
40
|
+
highWaterMark: isFunction(highWaterMark) ? highWaterMark : () => highWaterMark
|
|
41
|
+
};
|
|
46
42
|
}
|
|
47
43
|
/**
|
|
48
44
|
* @private
|
|
@@ -54,21 +50,15 @@ class Service {
|
|
|
54
50
|
*/
|
|
55
51
|
async #setupHeaders({ response }, path, stats) {
|
|
56
52
|
const options = this.#options;
|
|
57
|
-
const { headers } = options;
|
|
58
53
|
// Set status.
|
|
59
54
|
response.status = 200;
|
|
60
55
|
// Set Content-Type.
|
|
61
56
|
response.type = extname(path);
|
|
62
|
-
//
|
|
57
|
+
// Get headers.
|
|
58
|
+
const headers = await options.headers(path, stats);
|
|
59
|
+
// If headers not empty, set headers.
|
|
63
60
|
if (headers) {
|
|
64
|
-
|
|
65
|
-
const fields = await headers(path, stats);
|
|
66
|
-
if (fields) {
|
|
67
|
-
response.set(fields);
|
|
68
|
-
}
|
|
69
|
-
} else {
|
|
70
|
-
response.set(headers);
|
|
71
|
-
}
|
|
61
|
+
response.set(headers);
|
|
72
62
|
}
|
|
73
63
|
// Accept-Ranges.
|
|
74
64
|
if (options.acceptRanges === false) {
|
|
@@ -120,12 +110,12 @@ class Service {
|
|
|
120
110
|
if (isOutRoot(path, root)) {
|
|
121
111
|
return false;
|
|
122
112
|
}
|
|
113
|
+
// Get options.
|
|
114
|
+
const options = this.#options;
|
|
123
115
|
// Is ignore path or file (403).
|
|
124
|
-
if (
|
|
116
|
+
if (await options.ignore(path)) {
|
|
125
117
|
return false;
|
|
126
118
|
}
|
|
127
|
-
// Get options.
|
|
128
|
-
const options = this.#options;
|
|
129
119
|
// File stats.
|
|
130
120
|
const stats = await stat(options.fs, path);
|
|
131
121
|
// Check file stats.
|
|
@@ -182,7 +172,10 @@ class Service {
|
|
|
182
172
|
return context.throw(400);
|
|
183
173
|
}
|
|
184
174
|
// Set response body.
|
|
185
|
-
response.body = new ReadStream(path, ranges,
|
|
175
|
+
response.body = new ReadStream(path, ranges, {
|
|
176
|
+
fs: options.fs,
|
|
177
|
+
highWaterMark: await options.highWaterMark(path, stats)
|
|
178
|
+
});
|
|
186
179
|
// File found.
|
|
187
180
|
return true;
|
|
188
181
|
}
|
package/esm/server/dev/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/server/hot/Socket.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/server/hot/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/server/hot/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/server/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/server/schema.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/esm/server/utils.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @package webpack-dev-service
|
|
3
3
|
* @license MIT
|
|
4
|
-
* @version 0.15.
|
|
4
|
+
* @version 0.15.10
|
|
5
5
|
* @author nuintun <nuintun@qq.com>
|
|
6
6
|
* @description A koa 2 middleware for webpack development and hot reloading.
|
|
7
7
|
* @see https://github.com/nuintun/webpack-dev-service#readme
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpack-dev-service",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.10",
|
|
4
4
|
"description": "A koa 2 middleware for webpack development and hot reloading.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -50,11 +50,11 @@
|
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://github.com/nuintun/webpack-dev-service#readme",
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@nuintun/ansi": "^0.3.
|
|
54
|
-
"@types/koa": "^
|
|
53
|
+
"@nuintun/ansi": "^0.3.6",
|
|
54
|
+
"@types/koa": "^3.0.0",
|
|
55
55
|
"@types/ws": "^8.18.1",
|
|
56
56
|
"etag": "^1.8.1",
|
|
57
|
-
"memfs": "^4.
|
|
57
|
+
"memfs": "^4.28.0",
|
|
58
58
|
"range-parser": "^1.2.1",
|
|
59
59
|
"schema-utils": "^4.3.2",
|
|
60
60
|
"supports-color": "^10.0.0",
|
|
@@ -66,28 +66,28 @@
|
|
|
66
66
|
"@rollup/plugin-replace": "^6.0.2",
|
|
67
67
|
"@rollup/plugin-typescript": "^12.1.4",
|
|
68
68
|
"@rollup/plugin-url": "^8.0.2",
|
|
69
|
-
"@swc/core": "^1.13.
|
|
69
|
+
"@swc/core": "^1.13.3",
|
|
70
70
|
"@swc/helpers": "^0.5.17",
|
|
71
71
|
"@types/etag": "^1.8.4",
|
|
72
72
|
"@types/node": "^24.1.0",
|
|
73
73
|
"@types/range-parser": "^1.2.7",
|
|
74
|
-
"@types/react": "^19.1.
|
|
75
|
-
"@types/react-dom": "^19.1.
|
|
74
|
+
"@types/react": "^19.1.9",
|
|
75
|
+
"@types/react-dom": "^19.1.7",
|
|
76
76
|
"css-loader": "^7.1.2",
|
|
77
|
-
"dts-paths": "^1.1.
|
|
77
|
+
"dts-paths": "^1.1.11",
|
|
78
78
|
"html-webpack-plugin": "^5.6.3",
|
|
79
|
-
"koa": "^3.0.
|
|
79
|
+
"koa": "^3.0.1",
|
|
80
80
|
"koa-compress": "^5.1.1",
|
|
81
81
|
"magic-string": "^0.30.17",
|
|
82
82
|
"mini-css-extract-plugin": "^2.9.2",
|
|
83
83
|
"prettier": "^3.6.2",
|
|
84
|
-
"react": "^19.1.
|
|
85
|
-
"react-dom": "^19.1.
|
|
84
|
+
"react": "^19.1.1",
|
|
85
|
+
"react-dom": "^19.1.1",
|
|
86
86
|
"rimraf": "^6.0.1",
|
|
87
|
-
"rollup": "^4.
|
|
87
|
+
"rollup": "^4.46.2",
|
|
88
88
|
"swc-loader": "^0.2.6",
|
|
89
|
-
"typescript": "^5.
|
|
90
|
-
"webpack": "^5.
|
|
89
|
+
"typescript": "^5.9.2",
|
|
90
|
+
"webpack": "^5.101.0"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
93
|
"koa": ">=2.0.0",
|