@cloudflare/vite-plugin 1.16.0 → 1.17.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/index.mjs +5 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -13676,12 +13676,14 @@ const virtualModulesPlugin = createPlugin("virtual-modules", (ctx) => {
|
|
|
13676
13676
|
applyToEnvironment(environment) {
|
|
13677
13677
|
return ctx.getWorkerConfig(environment.name) !== void 0;
|
|
13678
13678
|
},
|
|
13679
|
-
resolveId(source) {
|
|
13679
|
+
async resolveId(source) {
|
|
13680
13680
|
if (source === VIRTUAL_WORKER_ENTRY || source === VIRTUAL_EXPORT_TYPES) return `\0${source}`;
|
|
13681
13681
|
if (source === VIRTUAL_USER_ENTRY) {
|
|
13682
13682
|
const workerConfig = ctx.getWorkerConfig(this.environment.name);
|
|
13683
13683
|
assert(workerConfig, "Expected `workerConfig` to be defined");
|
|
13684
|
-
|
|
13684
|
+
const main = await this.resolve(workerConfig.main);
|
|
13685
|
+
if (!main) throw new Error(`Failed to resolve main entry file "${workerConfig.main}" for environment "${this.environment.name}"`);
|
|
13686
|
+
return main;
|
|
13685
13687
|
}
|
|
13686
13688
|
},
|
|
13687
13689
|
load(id) {
|
|
@@ -13927,7 +13929,7 @@ const defaultConditions = [
|
|
|
13927
13929
|
"module",
|
|
13928
13930
|
"browser"
|
|
13929
13931
|
];
|
|
13930
|
-
const target = "
|
|
13932
|
+
const target = "es2024";
|
|
13931
13933
|
function createCloudflareEnvironmentOptions({ workerConfig, userConfig, mode, environmentName, isEntryWorker, hasNodeJsCompat: hasNodeJsCompat$1 }) {
|
|
13932
13934
|
const define$1 = getProcessEnvReplacements(hasNodeJsCompat$1, mode);
|
|
13933
13935
|
return {
|