@cloudflare/vite-plugin 1.57.3 → 2.0.0-beta.sha-b747ec8ea
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/cf-vite.mjs +2 -13
- package/dist/{chunk-Q72B4Q5Z-izl5Qmnx.mjs → chunk-6LYDFTTF-Kffb903d.mjs} +2 -2
- package/dist/{chunk-Q72B4Q5Z-izl5Qmnx.mjs.map → chunk-6LYDFTTF-Kffb903d.mjs.map} +1 -1
- package/dist/experimental-config.d.mts +1 -1781
- package/dist/experimental-config.mjs +2 -267
- package/dist/index.d.mts +36 -106
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +31191 -44106
- package/dist/index.mjs.map +1 -1
- package/dist/{open-PBXRGS4R-DFtj97wF.mjs → open-OYMIZX6T-NLY6qIcR.mjs} +3 -3
- package/dist/{open-PBXRGS4R-DFtj97wF.mjs.map → open-OYMIZX6T-NLY6qIcR.mjs.map} +1 -1
- package/dist/{package-Cyn1j4iY.mjs → package-BJ7U5J4t.mjs} +9 -11
- package/dist/package-BJ7U5J4t.mjs.map +1 -0
- package/package.json +12 -12
- package/dist/experimental-config.d.mts.map +0 -1
- package/dist/experimental-config.mjs.map +0 -1
- package/dist/package-Cyn1j4iY.mjs.map +0 -1
package/dist/cf-vite.mjs
CHANGED
|
@@ -2,11 +2,7 @@ import { parseArgs } from "node:util";
|
|
|
2
2
|
import { createBuilder, createServer } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/build-output-env.ts
|
|
5
|
-
/**
|
|
6
|
-
* Shared definition of the internal env var that the `cf-vite build`
|
|
7
|
-
* delegate uses to force the experimental Build Output Specification on by default.
|
|
8
|
-
*/
|
|
9
|
-
const FORCE_BUILD_OUTPUT_ENV_VAR = "CLOUDFLARE_VITE_FORCE_BUILD_OUTPUT";
|
|
5
|
+
/** Internal flag set by `cf-vite build --preview`. */
|
|
10
6
|
const PREVIEW_BUILD_ENV_VAR = "CLOUDFLARE_VITE_PREVIEW_BUILD";
|
|
11
7
|
|
|
12
8
|
//#endregion
|
|
@@ -22,17 +18,11 @@ const PREVIEW_BUILD_ENV_VAR = "CLOUDFLARE_VITE_PREVIEW_BUILD";
|
|
|
22
18
|
* Unknown/missing verbs exit 2 (also the parent's version-detection
|
|
23
19
|
* signal).
|
|
24
20
|
*
|
|
25
|
-
* Every verb forces the experimental Build Output Specification on by default by
|
|
26
|
-
* setting `CLOUDFLARE_VITE_FORCE_BUILD_OUTPUT` in `main()` before Vite
|
|
27
|
-
* loads the user's config; the plugin reads it during config resolution
|
|
28
|
-
* to enable `experimental.newConfig` + `experimental.newConfig.cfBuildOutput`.
|
|
29
|
-
*
|
|
30
21
|
* Spawn contract for `dev`: parent uses `stdio: "inherit"` and forwards
|
|
31
22
|
* SIGINT/SIGTERM. Accepted flags mirror the sibling `cf-wrangler`
|
|
32
23
|
* delegate (`--mode`, `--port`, `--host`, `--local`) so the parent can
|
|
33
24
|
* drive either impl interchangeably; everything else lives in the user's
|
|
34
|
-
* `vite.config.ts` / `
|
|
35
|
-
* file, which is discovered by `cloudflare()` itself). `cf-vite` boots
|
|
25
|
+
* `vite.config.ts` / `cloudflare.config.ts`. `cf-vite` boots
|
|
36
26
|
* Vite via `createServer()` against the user's own config (expected to
|
|
37
27
|
* include `cloudflare()`); flags are bridged to it as documented inline.
|
|
38
28
|
*
|
|
@@ -103,7 +93,6 @@ function parseBuildArgs(argv) {
|
|
|
103
93
|
async function main() {
|
|
104
94
|
const verb = process.argv[2];
|
|
105
95
|
const userArgv = process.argv.slice(3);
|
|
106
|
-
process.env[FORCE_BUILD_OUTPUT_ENV_VAR] = "true";
|
|
107
96
|
if (verb === "dev") return runDev(userArgv);
|
|
108
97
|
if (verb === "build") return runBuild(userArgv);
|
|
109
98
|
process.stderr.write(`Error: unknown subcommand "${verb ?? ""}".\nUsage: cf-vite <dev|build> [args]\n`);
|
|
@@ -27,7 +27,7 @@ var __toESM$1 = (mod, isNodeMode, target) => (target = mod != null ? __create$1(
|
|
|
27
27
|
var __require$1 = /* @__PURE__ */ createRequire(import.meta.url);
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
|
-
//#region ../workers-utils/dist/chunk-
|
|
30
|
+
//#region ../workers-utils/dist/chunk-6LYDFTTF.mjs
|
|
31
31
|
var __create = Object.create;
|
|
32
32
|
var __defProp = Object.defineProperty;
|
|
33
33
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -67,4 +67,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
67
67
|
|
|
68
68
|
//#endregion
|
|
69
69
|
export { __toESM as a, __toESM$1 as c, __require as i, __export as n, __commonJS$1 as o, __name as r, __require$1 as s, __commonJS as t };
|
|
70
|
-
//# sourceMappingURL=chunk-
|
|
70
|
+
//# sourceMappingURL=chunk-6LYDFTTF-Kffb903d.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-
|
|
1
|
+
{"version":3,"file":"chunk-6LYDFTTF-Kffb903d.mjs","names":[],"sources":["../../workers-utils/dist/chunk-6LYDFTTF.mjs"],"sourcesContent":["var __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", { value, configurable: true });\nvar __require = /* @__PURE__ */ ((x) => typeof require !== \"undefined\" ? require : typeof Proxy !== \"undefined\" ? new Proxy(x, {\n get: (a, b) => (typeof require !== \"undefined\" ? require : a)[b]\n}) : x)(function(x) {\n if (typeof require !== \"undefined\") return require.apply(this, arguments);\n throw Error('Dynamic require of \"' + x + '\" is not supported');\n});\nvar __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\n\nexport { __commonJS, __export, __name, __require, __toESM };\n//# sourceMappingURL=chunk-6LYDFTTF.mjs.map\n//# sourceMappingURL=chunk-6LYDFTTF.mjs.map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,UAAU,QAAQ,UAAU,UAAU,QAAQ,QAAQ;CAAE;CAAO,cAAc;CAAM,CAAC;AACxF,IAAI,YAA4B,kBAAE,MAAM,uBAAmB,4BAAwB,OAAO,UAAU,cAAc,IAAI,MAAM,GAAG,EAC7H,MAAM,GAAG,OAAO,uBAAmB,4BAAwB,GAAG,IAC/D,CAAC,GAAG,GAAG,SAAS,GAAG;AAClB,KAAI,uBAAmB,YAAa,oBAAe,MAAM,MAAM,UAAU;AACzE,OAAM,MAAM,0BAAyB,IAAI,sBAAqB;EAC9D;AACF,IAAI,cAAc,IAAI,QAAQ,SAAS,aAAa;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