@netlify/vite-plugin 2.3.9 → 2.4.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/dist/main.js +1 -22
- package/package.json +8 -4
package/dist/main.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/main.ts
|
|
2
2
|
import process from "process";
|
|
3
3
|
import { NetlifyDev } from "@netlify/dev";
|
|
4
|
-
import { netlifyCommand } from "@netlify/dev-utils";
|
|
4
|
+
import { fromWebResponse, netlifyCommand } from "@netlify/dev-utils";
|
|
5
5
|
|
|
6
6
|
// src/lib/logger.ts
|
|
7
7
|
import { netlifyBanner } from "@netlify/dev-utils";
|
|
@@ -11,27 +11,6 @@ var createLoggerFromViteLogger = (viteLogger) => ({
|
|
|
11
11
|
warn: (msg) => viteLogger.warn(msg ?? "", { timestamp: true, environment: netlifyBanner })
|
|
12
12
|
});
|
|
13
13
|
|
|
14
|
-
// src/lib/reqres.ts
|
|
15
|
-
import { Readable } from "stream";
|
|
16
|
-
var fromWebResponse = async (webRes, res) => {
|
|
17
|
-
res.statusCode = webRes.status;
|
|
18
|
-
webRes.headers.forEach((value, name) => {
|
|
19
|
-
res.setHeader(name, value);
|
|
20
|
-
});
|
|
21
|
-
if (webRes.body) {
|
|
22
|
-
const reader = webRes.body.getReader();
|
|
23
|
-
const writer = res;
|
|
24
|
-
while (true) {
|
|
25
|
-
const { done, value } = await reader.read();
|
|
26
|
-
if (done) {
|
|
27
|
-
break;
|
|
28
|
-
}
|
|
29
|
-
writer.write(value);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
res.end();
|
|
33
|
-
};
|
|
34
|
-
|
|
35
14
|
// src/main.ts
|
|
36
15
|
function netlify(options = {}) {
|
|
37
16
|
if (process.env.NETLIFY_DEV) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@netlify/vite-plugin",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Vite plugin with a local emulation of the Netlify environment",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
"dev": "tsup-node --watch",
|
|
22
22
|
"publint": "npx -y publint --strict"
|
|
23
23
|
},
|
|
24
|
-
"keywords": [
|
|
24
|
+
"keywords": [
|
|
25
|
+
"netlify",
|
|
26
|
+
"vite-plugin",
|
|
27
|
+
"dev"
|
|
28
|
+
],
|
|
25
29
|
"license": "MIT",
|
|
26
30
|
"repository": "netlify/primitives",
|
|
27
31
|
"bugs": {
|
|
@@ -36,8 +40,8 @@
|
|
|
36
40
|
"vitest": "^3.0.0"
|
|
37
41
|
},
|
|
38
42
|
"dependencies": {
|
|
39
|
-
"@netlify/dev": "4.
|
|
40
|
-
"@netlify/dev-utils": "^3.
|
|
43
|
+
"@netlify/dev": "4.4.1",
|
|
44
|
+
"@netlify/dev-utils": "^3.3.0",
|
|
41
45
|
"chalk": "^5.4.1"
|
|
42
46
|
},
|
|
43
47
|
"peerDependencies": {
|