@cloudflare/worker-bundler 0.2.0 → 0.2.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License Copyright (c) 2025 Cloudflare, Inc.
2
+
3
+ Permission is hereby granted, free of
4
+ charge, to any person obtaining a copy of this software and associated
5
+ documentation files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use, copy, modify, merge,
7
+ publish, distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to the
9
+ following conditions:
10
+
11
+ The above copyright notice and this permission notice
12
+ (including the next paragraph) shall be included in all copies or substantial
13
+ portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
16
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
18
+ EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -397,7 +397,7 @@ const result = await createApp({
397
397
  const worker = env.LOADER.get(loaderId, () => ({
398
398
  mainModule: result.mainModule,
399
399
  modules: result.modules,
400
- compatibilityDate: "2026-01-28"
400
+ compatibilityDate: "2026-06-11"
401
401
  }));
402
402
 
403
403
  // Mount as a facet for persistent storage
package/dist/esbuild.wasm CHANGED
Binary file
@@ -136,4 +136,4 @@ export {
136
136
  FileSystem as r,
137
137
  DurableObjectKVFileSystem as t
138
138
  };
139
- //# sourceMappingURL=file-system-BQyEt1bf.d.ts.map
139
+ //# sourceMappingURL=file-system-PsI0bi2L.d.ts.map
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  n as DurableObjectRawFileSystem,
5
5
  r as FileSystem,
6
6
  t as DurableObjectKVFileSystem
7
- } from "./file-system-BQyEt1bf.js";
7
+ } from "./file-system-PsI0bi2L.js";
8
8
 
9
9
  //#region src/types.d.ts
10
10
  /**
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as hasDependencies, r as installDependencies } from "./installer-DM2snqBY.js";
1
+ import { n as hasDependencies, r as installDependencies } from "./installer-Ns4ivVf5.js";
2
2
  import * as esbuild from "esbuild-wasm/lib/browser.js";
3
3
  import { parse } from "es-module-lexer/js";
4
4
  import * as resolveExports from "resolve.exports";
@@ -188,7 +188,7 @@ function parseImports(code) {
188
188
  */
189
189
  function parseImportsRegex(code) {
190
190
  const imports = [];
191
- for (const match of code.matchAll(/import\s+(?:(?:[\w*{}\s,]+)\s+from\s+)?['"]([^'"]+)['"]/g)) {
191
+ for (const match of code.matchAll(/\bimport\b\s+(?:(?:(?!\b(?:import|export)\b)[\w*{},])+(?:\s+(?:(?!\b(?:import|export)\b)[\w*{},])+)*\s+from\s+)?['"]([^'"]+)['"]/g)) {
192
192
  const specifier = match[1];
193
193
  if (specifier) imports.push(specifier);
194
194
  }
@@ -196,7 +196,7 @@ function parseImportsRegex(code) {
196
196
  const specifier = match[1];
197
197
  if (specifier) imports.push(specifier);
198
198
  }
199
- for (const match of code.matchAll(/export\s+(?:[\w*{}\s,]+\s+)?from\s+['"]([^'"]+)['"]/g)) {
199
+ for (const match of code.matchAll(/\bexport\b\s+(?:(?:(?!\b(?:import|export)\b)[\w*{},])+(?:\s+(?:(?!\b(?:import|export)\b)[\w*{},])+)*\s+)?from\s+['"]([^'"]+)['"]/g)) {
200
200
  const specifier = match[1];
201
201
  if (specifier) imports.push(specifier);
202
202
  }
@@ -713,7 +713,7 @@ async function transformAndResolve(files, entryPoint, externals) {
713
713
  * This is necessary because the Worker Loader expects imports to match registered module names.
714
714
  */
715
715
  function rewriteImports(code, importer, files, pathMap, externals) {
716
- const importExportRegex = /(import\s+(?:[\w*{}\s,]+\s+from\s+)?|export\s+(?:[\w*{}\s,]+\s+)?from\s+)(['"])([^'"]+)\2/g;
716
+ const importExportRegex = /(\bimport\b\s+(?:(?:(?!\b(?:import|export)\b)[\w*{},])+(?:\s+(?:(?!\b(?:import|export)\b)[\w*{},])+)*\s+from\s+)?|\bexport\b\s+(?:(?:(?!\b(?:import|export)\b)[\w*{},])+(?:\s+(?:(?!\b(?:import|export)\b)[\w*{},])+)*\s+)?from\s+)(['"])([^'"]+)\2/g;
717
717
  const importerOutputPath = pathMap.get(importer) ?? importer;
718
718
  return code.replace(importExportRegex, (match, prefix, quote, specifier) => {
719
719
  if (externals.includes(specifier) || externals.some((e) => specifier.startsWith(`${e}/`) || specifier.startsWith(e))) return match;