@cloudflare/vite-plugin 1.7.3 → 1.7.5
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/index.js +7 -22
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -13485,7 +13485,7 @@ import { unstable_readConfig } from "wrangler";
|
|
|
13485
13485
|
function getDeployConfigPath(root) {
|
|
13486
13486
|
return path6.resolve(root, ".wrangler", "deploy", "config.json");
|
|
13487
13487
|
}
|
|
13488
|
-
function getWorkerConfigs(root
|
|
13488
|
+
function getWorkerConfigs(root) {
|
|
13489
13489
|
const deployConfigPath = getDeployConfigPath(root);
|
|
13490
13490
|
const deployConfig = JSON.parse(
|
|
13491
13491
|
fs3.readFileSync(deployConfigPath, "utf-8")
|
|
@@ -13498,10 +13498,7 @@ function getWorkerConfigs(root, remoteBindingsEnabled) {
|
|
|
13498
13498
|
path6.dirname(deployConfigPath),
|
|
13499
13499
|
configPath
|
|
13500
13500
|
);
|
|
13501
|
-
return unstable_readConfig(
|
|
13502
|
-
{ config: resolvedConfigPath },
|
|
13503
|
-
{ experimental: { remoteBindingsEnabled } }
|
|
13504
|
-
);
|
|
13501
|
+
return unstable_readConfig({ config: resolvedConfigPath });
|
|
13505
13502
|
});
|
|
13506
13503
|
}
|
|
13507
13504
|
function getRelativePathToWorkerConfig(deployConfigDirectory, root, outputDirectory) {
|
|
@@ -14292,15 +14289,12 @@ var nullableNonApplicable = [
|
|
|
14292
14289
|
"site",
|
|
14293
14290
|
"tsconfig"
|
|
14294
14291
|
];
|
|
14295
|
-
function readWorkerConfig(configPath, env2
|
|
14292
|
+
function readWorkerConfig(configPath, env2) {
|
|
14296
14293
|
const nonApplicable = {
|
|
14297
14294
|
replacedByVite: /* @__PURE__ */ new Set(),
|
|
14298
14295
|
notRelevant: /* @__PURE__ */ new Set()
|
|
14299
14296
|
};
|
|
14300
|
-
const config = unstable_readConfig2(
|
|
14301
|
-
{ config: configPath, env: env2 },
|
|
14302
|
-
{ experimental: { remoteBindingsEnabled } }
|
|
14303
|
-
);
|
|
14297
|
+
const config = unstable_readConfig2({ config: configPath, env: env2 });
|
|
14304
14298
|
const raw = structuredClone(config);
|
|
14305
14299
|
nullableNonApplicable.forEach((prop) => {
|
|
14306
14300
|
if (config[prop] !== void 0) {
|
|
@@ -14395,15 +14389,11 @@ function isNotRelevant(configName) {
|
|
|
14395
14389
|
function missingFieldErrorMessage(field, configPath, env2) {
|
|
14396
14390
|
return `No ${field} field provided in '${configPath}'${env2 ? ` for '${env2}' environment` : ""}`;
|
|
14397
14391
|
}
|
|
14398
|
-
function getWorkerConfig(configPath, env2,
|
|
14392
|
+
function getWorkerConfig(configPath, env2, opts) {
|
|
14399
14393
|
if (opts?.visitedConfigPaths?.has(configPath)) {
|
|
14400
14394
|
throw new Error(`Duplicate Wrangler config path found: ${configPath}`);
|
|
14401
14395
|
}
|
|
14402
|
-
const { raw, config, nonApplicable } = readWorkerConfig(
|
|
14403
|
-
configPath,
|
|
14404
|
-
env2,
|
|
14405
|
-
remoteBindingsEnabled
|
|
14406
|
-
);
|
|
14396
|
+
const { raw, config, nonApplicable } = readWorkerConfig(configPath, env2);
|
|
14407
14397
|
opts?.visitedConfigPaths?.add(configPath);
|
|
14408
14398
|
if (!config.name) {
|
|
14409
14399
|
throw new Error(missingFieldErrorMessage(`'name'`, configPath, env2));
|
|
@@ -14521,10 +14511,7 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
|
|
|
14521
14511
|
return {
|
|
14522
14512
|
...shared,
|
|
14523
14513
|
type: "preview",
|
|
14524
|
-
workers: getWorkerConfigs(
|
|
14525
|
-
root,
|
|
14526
|
-
shared.experimental.remoteBindings ?? false
|
|
14527
|
-
)
|
|
14514
|
+
workers: getWorkerConfigs(root)
|
|
14528
14515
|
};
|
|
14529
14516
|
}
|
|
14530
14517
|
const configPaths = /* @__PURE__ */ new Set();
|
|
@@ -14541,7 +14528,6 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
|
|
|
14541
14528
|
const entryWorkerResolvedConfig = getWorkerConfig(
|
|
14542
14529
|
entryWorkerConfigPath,
|
|
14543
14530
|
cloudflareEnv,
|
|
14544
|
-
pluginConfig.experimental?.remoteBindings ?? false,
|
|
14545
14531
|
{
|
|
14546
14532
|
visitedConfigPaths: configPaths,
|
|
14547
14533
|
isEntryWorker: true
|
|
@@ -14580,7 +14566,6 @@ function resolvePluginConfig(pluginConfig, userConfig, viteEnv) {
|
|
|
14580
14566
|
const workerResolvedConfig = getWorkerConfig(
|
|
14581
14567
|
workerConfigPath,
|
|
14582
14568
|
cloudflareEnv,
|
|
14583
|
-
pluginConfig.experimental?.remoteBindings ?? false,
|
|
14584
14569
|
{
|
|
14585
14570
|
visitedConfigPaths: configPaths
|
|
14586
14571
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/vite-plugin",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
4
4
|
"description": "Cloudflare plugin for Vite",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cloudflare",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"tinyglobby": "^0.2.12",
|
|
42
42
|
"unenv": "2.0.0-rc.17",
|
|
43
43
|
"ws": "8.18.0",
|
|
44
|
-
"
|
|
45
|
-
"
|
|
44
|
+
"wrangler": "4.21.1",
|
|
45
|
+
"miniflare": "4.20250617.4"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@cloudflare/workers-types": "^4.20250617.0",
|