@netlify/edge-bundler
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -7,2 +7,3 @@ import { OnAfterDownloadHook, OnBeforeDownloadHook } from './bridge.js'; | ||
interface BundleOptions { | ||
basePath?: string; | ||
cacheDirectory?: string; | ||
@@ -16,3 +17,3 @@ debug?: boolean; | ||
} | ||
declare const bundle: (sourceDirectories: string[], distDirectory: string, declarations?: Declaration[], { cacheDirectory, debug, distImportMapPath, featureFlags: inputFeatureFlags, importMaps, onAfterDownload, onBeforeDownload, }?: BundleOptions) => Promise<{ | ||
declare const bundle: (sourceDirectories: string[], distDirectory: string, declarations?: Declaration[], { basePath: inputBasePath, cacheDirectory, debug, distImportMapPath, featureFlags: inputFeatureFlags, importMaps, onAfterDownload, onBeforeDownload, }?: BundleOptions) => Promise<{ | ||
functions: EdgeFunction[]; | ||
@@ -19,0 +20,0 @@ manifest: import("./manifest.js").Manifest; |
@@ -38,3 +38,3 @@ import { promises as fs } from 'fs'; | ||
}; | ||
const bundle = async (sourceDirectories, distDirectory, declarations = [], { cacheDirectory, debug, distImportMapPath, featureFlags: inputFeatureFlags, importMaps, onAfterDownload, onBeforeDownload, } = {}) => { | ||
const bundle = async (sourceDirectories, distDirectory, declarations = [], { basePath: inputBasePath, cacheDirectory, debug, distImportMapPath, featureFlags: inputFeatureFlags, importMaps, onAfterDownload, onBeforeDownload, } = {}) => { | ||
const featureFlags = getFlags(inputFeatureFlags); | ||
@@ -47,3 +47,3 @@ const deno = new DenoBridge({ | ||
}); | ||
const basePath = getBasePath(sourceDirectories); | ||
const basePath = getBasePath(sourceDirectories, inputBasePath); | ||
await ensureLatestTypes(deno); | ||
@@ -92,3 +92,7 @@ // The name of the bundle will be the hash of its contents, which we can't | ||
}; | ||
const getBasePath = (sourceDirectories) => { | ||
const getBasePath = (sourceDirectories, inputBasePath) => { | ||
// If there's a specific base path supplied, that takes precedence. | ||
if (inputBasePath !== undefined) { | ||
return inputBasePath; | ||
} | ||
// `common-path-prefix` returns an empty string when called with a single | ||
@@ -95,0 +99,0 @@ // path, so we check for that case and return the path itself instead. |
{ | ||
"name": "@netlify/edge-bundler", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "Intelligently prepare Netlify Edge Functions for deployment", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47418
1095