@cloudflare/worker-bundler 0.2.1 → 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/README.md +1 -1
- package/dist/esbuild.wasm +0 -0
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/typescript.js +6414 -6408
- package/dist/typescript.js.map +1 -1
- package/package.json +8 -8
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-
|
|
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
|
package/dist/index.js
CHANGED
|
@@ -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(
|
|
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(
|
|
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*{}
|
|
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;
|