rspack-plugin-cloudflare 0.5.1 → 0.5.3

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.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["PLUGIN_NAME","fs","isPlainObject","types","standardTypes","otherTypes","mime","fs","PLUGIN_NAME"],"sources":["../src/module-rules.ts","../src/nodejs-compat.ts","../src/worker-config.ts","../src/build.ts","../src/config.ts","../src/miniflare.ts","../workers-sdk/packages/workers-shared/utils/configuration/constants.ts","../workers-sdk/packages/workers-shared/utils/configuration/constructConfiguration.ts","../workers-sdk/packages/workers-shared/utils/configuration/validateURL.ts","../workers-sdk/packages/workers-shared/utils/configuration/parseHeaders.ts","../workers-sdk/packages/workers-shared/utils/configuration/parseRedirects.ts","../node_modules/ignore/index.js","../node_modules/mime/dist/types/other.js","../node_modules/mime/dist/types/standard.js","../node_modules/mime/dist/src/Mime.js","../node_modules/mime/dist/src/index.js","../workers-sdk/packages/workers-shared/utils/helpers.ts","../src/assets.ts","../src/containers.ts","../src/dev-entry.ts","../src/dev-worker.ts","../src/http.ts","../src/inspector.ts","../src/dev.ts","../src/tunnel.ts","../src/index.ts"],"sourcesContent":["import path from 'node:path';\n\nimport type { ResolvedWorker } from './config.js';\n\nexport type ModuleType = 'CompiledWasm' | 'Data' | 'Text';\n\n// wrangler's defaults, which apply after any rules in the config\nconst DEFAULT_RULES: { type: ModuleType; globs: string[]; }[] = [\n\t{ type: 'Text', globs: ['**/*.txt', '**/*.html', '**/*.sql'] },\n\t{ type: 'Data', globs: ['**/*.bin'] },\n\t{ type: 'CompiledWasm', globs: ['**/*.wasm', '**/*.wasm?module'] },\n];\n\nconst MODULE_TYPES: readonly string[] = ['CompiledWasm', 'Data', 'Text'] satisfies ModuleType[];\n\nfunction isModuleType(type: string): type is ModuleType {\n\treturn MODULE_TYPES.includes(type);\n}\n\n/** Maps file extensions to the non-JS module type wrangler would give them, with config rules taking precedence. */\nexport function getModuleTypes(worker: ResolvedWorker) {\n\tconst types = new Map<string, ModuleType>();\n\tfor (const rule of [...worker.config.rules, ...DEFAULT_RULES]) {\n\t\tif (!isModuleType(rule.type)) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const glob of rule.globs) {\n\t\t\t// wrangler's module rules use `**/*.ext` style globs, so the extension is all that matters\n\t\t\tconst extension = path.extname(glob.replace(/\\?.*$/, ''));\n\t\t\tif (extension && !types.has(extension)) {\n\t\t\t\ttypes.set(extension, rule.type);\n\t\t\t}\n\t\t}\n\t}\n\treturn types;\n}\n","import { fileURLToPath } from 'node:url';\n\nimport { getCloudflarePreset } from '@cloudflare/unenv-preset';\n// from workers-utils rather than Miniflare, which comes from the user's wrangler and dropped this export in 5.20261103\nimport { getNodeCompat } from '@cloudflare/workers-utils';\nimport { defineEnv } from 'unenv';\n\nimport type { ResolvedWorker } from './config.js';\n\nexport interface NodeJsCompat {\n\t/** Builtin specifiers workerd provides natively, mapped to the specifier to import at runtime. */\n\texternals: Map<string, string>;\n\t/** Builtin specifiers workerd lacks, mapped to the unenv polyfill file that replaces them. */\n\tpolyfills: Map<string, string>;\n\t/** A module that sets up injected globals like `process` and runs polyfills, when the preset needs any. */\n\tinjectSource: string | undefined;\n}\n\nfunction resolvePolyfill(specifier: string) {\n\t// polyfills are this package's dependencies, which the user's project can't necessarily resolve\n\treturn fileURLToPath(import.meta.resolve(specifier));\n}\n\nfunction createInjectSource(inject: Record<string, string | readonly string[]>, polyfills: readonly string[]) {\n\tconst lines: string[] = [];\n\tfor (const [index, [globalName, specifier]] of Object.entries(inject).entries()) {\n\t\tconst [moduleSpecifier, exportName] = typeof specifier === 'string' ? [specifier, 'default'] : specifier;\n\t\tif (!moduleSpecifier || !exportName) {\n\t\t\tcontinue;\n\t\t}\n\t\tlines.push(\n\t\t\t`import { ${exportName} as inject${index} } from ${JSON.stringify(resolvePolyfill(moduleSpecifier))};`,\n\t\t\t`globalThis.${globalName} = inject${index};`,\n\t\t);\n\t}\n\tfor (const polyfill of polyfills) {\n\t\tlines.push(`import ${JSON.stringify(resolvePolyfill(polyfill))};`);\n\t}\n\treturn lines.length > 0 ? lines.join('\\n') : undefined;\n}\n\n/**\n * Applies Cloudflare's unenv preset, as wrangler and the Vite plugin do: modules workerd has natively stay external,\n * the rest are polyfilled, and globals like `process` are injected for older compatibility dates.\n */\nexport function getNodeJsCompat(worker: ResolvedWorker): NodeJsCompat | undefined {\n\tconst { compatibility_date: compatibilityDate, compatibility_flags: compatibilityFlags } = worker.config;\n\tif (!getNodeCompat(compatibilityDate, compatibilityFlags).isNodejsCompatEnabled) {\n\t\treturn undefined;\n\t}\n\tconst { env } = defineEnv({ presets: [getCloudflarePreset({ compatibilityDate, compatibilityFlags })] });\n\tconst nativeModules = new Set(env.external);\n\tconst externals = new Map<string, string>();\n\tconst polyfills = new Map<string, string>();\n\tfor (const [specifier, target] of Object.entries(env.alias)) {\n\t\tif (nativeModules.has(target)) {\n\t\t\texternals.set(specifier, target);\n\t\t} else {\n\t\t\tpolyfills.set(specifier, resolvePolyfill(target));\n\t\t}\n\t}\n\treturn { externals, polyfills, injectSource: createInjectSource(env.inject, env.polyfill) };\n}\n","import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport { isBuiltin } from 'node:module';\nimport path from 'node:path';\n\nimport { getModuleTypes } from './module-rules.js';\nimport { getNodeJsCompat } from './nodejs-compat.js';\n\nimport type { ResolvedWorker } from './config.js';\nimport type { ModuleType } from './module-rules.js';\nimport type { NodeJsCompat } from './nodejs-compat.js';\nimport type { CloudflarePluginOptions } from './options.js';\nimport type { Compiler, RspackOptions, RspackPluginInstance } from '@rspack/core';\n\n/** The rspack plugin that holds generated modules, which dev rewrites when the Worker's exports change. */\nexport type VirtualModules = InstanceType<Compiler['rspack']['experiments']['VirtualModulesPlugin']>;\n\nconst PLUGIN_NAME = 'rspack-plugin-cloudflare';\nconst TYPESCRIPT_RE = /\\.[cm]?tsx?$/;\n// the static asset types Vite also imports as URLs; .txt stays a Text module, as wrangler treats it\nconst ASSET_RE = /\\.(?:apng|avif|bmp|cur|eot|flac|gif|ico|jfif|jpe?g|jxl|m4a|mov|mp3|mp4|ogg|opus|otf|pdf|pjp|pjpeg|png|svg|ttf|vtt|wav|webm|webmanifest|webp|woff2?|aac)$/i;\n// `?url` imports any file as a URL, like Vite\nconst URL_QUERY_RE = /\\?(?:[^#]*&)?url(?:[&=#]|$)/;\n\n/** Output subdirectory for assets Worker code imports, laid out the way the assets directory serves them. */\nexport const IMPORTED_ASSETS_DIR = 'imported-assets';\n\ninterface AdditionalModule {\n\t/** File name in the output directory, which is also how the bundle imports it. */\n\tfileName: string;\n\ttype: 'CompiledWasm' | 'Data';\n}\n\n/** Copies imported `.wasm`/`.bin` files next to the bundle, where workerd loads them as their own modules. */\nexport class AdditionalModulesPlugin implements RspackPluginInstance {\n\treadonly #files = new Map<string, { sourcePath: string; type: AdditionalModule['type']; }>();\n\n\t/** Every file emitted so far; dev passes these to Miniflare, since rspack's incremental asset list can leave them out. */\n\tget modules(): AdditionalModule[] {\n\t\treturn [...this.#files].map(([fileName, { type }]) => {\n\t\t\treturn { fileName, type };\n\t\t});\n\t}\n\n\t/** Records a file to emit and returns the specifier the bundle should import it by. */\n\tadd(sourcePath: string, type: AdditionalModule['type']) {\n\t\tconst hash = createHash('sha1').update(fs.readFileSync(sourcePath)).digest('hex')\n\t\t\t.slice(0, 16);\n\t\tconst fileName = `${hash}-${path.basename(sourcePath)}`;\n\t\tthis.#files.set(fileName, { sourcePath, type });\n\t\treturn `./${fileName}`;\n\t}\n\n\tapply(compiler: Compiler) {\n\t\tconst { Compilation, sources } = compiler.rspack;\n\t\tcompiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {\n\t\t\tcompilation.hooks.processAssets.tap({ name: PLUGIN_NAME, stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL }, () => {\n\t\t\t\tfor (const [fileName, { sourcePath }] of this.#files) {\n\t\t\t\t\tcompilation.emitAsset(fileName, new sources.RawSource(fs.readFileSync(sourcePath)));\n\t\t\t\t\tcompilation.fileDependencies.add(sourcePath);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n\nfunction createExternals(nodeJsCompat: NodeJsCompat | undefined, moduleTypes: Map<string, ModuleType>, additionalModules: AdditionalModulesPlugin) {\n\ttype ExternalsCallback = (error?: Error, result?: string) => void;\n\treturn ({ request, context }: { request?: string; context?: string; }, callback: ExternalsCallback) => {\n\t\tif (!request) {\n\t\t\tcallback();\n\t\t\treturn;\n\t\t}\n\t\tif (request.startsWith('cloudflare:')) {\n\t\t\tcallback(undefined, request);\n\t\t\treturn;\n\t\t}\n\t\tif (nodeJsCompat) {\n\t\t\tconst native = nodeJsCompat.externals.get(request);\n\t\t\tif (native) {\n\t\t\t\tcallback(undefined, native);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// a builtin the preset doesn't know about yet; workerd only resolves the node: form\n\t\t\tif (isBuiltin(request) && !nodeJsCompat.polyfills.has(request)) {\n\t\t\t\tcallback(undefined, request.startsWith('node:') ? request : `node:${request}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tconst filePath = request.replace(/\\?.*$/, '');\n\t\tconst type = moduleTypes.get(path.extname(filePath));\n\t\tconst isModule = type === 'CompiledWasm' || type === 'Data';\n\t\tif (isModule && !URL_QUERY_RE.test(request) && context && (filePath.startsWith('.') || path.isAbsolute(filePath))) {\n\t\t\tcallback(undefined, additionalModules.add(path.resolve(context, filePath), type));\n\t\t\treturn;\n\t\t}\n\t\tcallback();\n\t};\n}\n\n/** Text modules inline as strings; with an assets directory, static files and `?url` imports become URLs served from it. */\nfunction getAssetRules(worker: ResolvedWorker, textExtensions: Set<string>) {\n\tconst textRule = { test: (file: string) => textExtensions.has(path.extname(file)), type: 'asset/source' };\n\tif (!worker.assets) {\n\t\treturn [textRule];\n\t}\n\tconst generator = {\n\t\tfilename: 'assets/[name].[contenthash:8][ext]',\n\t\toutputPath: IMPORTED_ASSETS_DIR,\n\t\t// served from the root of the assets directory, not the Worker's own public path\n\t\tpublicPath: '/',\n\t};\n\treturn [\n\t\t{ resourceQuery: URL_QUERY_RE, type: 'asset/resource', generator },\n\t\ttextRule,\n\t\t{ test: ASSET_RE, type: 'asset/resource', generator },\n\t];\n}\n\n/** Builds the rspack config for the Worker bundle: a single ESM file workerd can load as-is. */\nexport function createWorkerConfig(options: {\n\tcompiler: Compiler;\n\tworker: ResolvedWorker;\n\tpluginOptions: CloudflarePluginOptions;\n\toutputDir: string;\n\t/** The module to bundle. */\n\tentry: string;\n\t/** Source for `entry` when it isn't a real file, like dev's wrapper around `main`. */\n\tentrySource?: string;\n\tmode: 'development' | 'production';\n\t/** Builds in rspack's HMR runtime so dev can update the running Worker in place. */\n\thot?: boolean;\n\t/** Where HMR imports update chunks from; workerd has no import.meta.url to derive it from. */\n\tpublicPath?: string;\n}): { config: RspackOptions; virtualModules: VirtualModules; additionalModules: AdditionalModulesPlugin; } {\n\tconst { compiler, worker, pluginOptions, outputDir, entry, entrySource, mode, hot = false, publicPath = '/' } = options;\n\tconst { rspack } = compiler;\n\tconst moduleTypes = getModuleTypes(worker);\n\tconst textExtensions = new Set([...moduleTypes].filter(([, type]) => type === 'Text').map(([extension]) => extension));\n\tconst additionalModules = new AdditionalModulesPlugin();\n\tconst nodeJsCompat = getNodeJsCompat(worker);\n\n\tconst virtualModules: Record<string, string> = {};\n\tconst entries = [entry];\n\tif (entrySource !== undefined) {\n\t\tvirtualModules[entry] = entrySource;\n\t}\n\tif (nodeJsCompat?.injectSource) {\n\t\t// runs before the Worker so injected globals like `process` exist while its modules evaluate\n\t\tconst injectPath = path.join(worker.rootDir, '.wrangler', 'tmp', `rspack-${worker.name}`, 'nodejs-compat-inject.js');\n\t\tvirtualModules[injectPath] = nodeJsCompat.injectSource;\n\t\tentries.unshift(injectPath);\n\t}\n\n\tconst plugins: RspackPluginInstance[] = [\n\t\tnew rspack.DefinePlugin(worker.config.define),\n\t\t// workerd loads a single module here, so keep dynamic imports in the entry chunk\n\t\tnew rspack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }),\n\t\tadditionalModules,\n\t];\n\tconst polyfills = nodeJsCompat?.polyfills;\n\tif (polyfills && polyfills.size > 0) {\n\t\t// rspack reads `node:` specifiers as a URL scheme that resolve.alias never sees, so swap polyfills in before resolving\n\t\tplugins.push(new rspack.NormalModuleReplacementPlugin(/^(?:node:)?[a-z_]/, (resource: { request: string; }) => {\n\t\t\tconst polyfill = polyfills.get(resource.request);\n\t\t\tif (polyfill) {\n\t\t\t\tresource.request = polyfill;\n\t\t\t}\n\t\t}));\n\t}\n\tconst virtualModulesPlugin = new rspack.experiments.VirtualModulesPlugin(virtualModules);\n\tplugins.push(virtualModulesPlugin);\n\tif (hot) {\n\t\tplugins.push(new rspack.HotModuleReplacementPlugin());\n\t}\n\n\tlet config: RspackOptions = {\n\t\tname: `cloudflare:${worker.name}`,\n\t\tmode,\n\t\tcontext: worker.rootDir,\n\t\ttarget: ['webworker', 'es2024'],\n\t\tentry: { index: entries },\n\t\toutput: {\n\t\t\tpath: outputDir,\n\t\t\tfilename: 'index.js',\n\t\t\tmodule: true,\n\t\t\tchunkFormat: 'module',\n\t\t\tlibrary: { type: 'module' },\n\t\t\tclean: true,\n\t\t\tpublicPath,\n\t\t},\n\t\texternalsType: 'module-import',\n\t\texternals: [createExternals(nodeJsCompat, moduleTypes, additionalModules)],\n\t\tresolve: {\n\t\t\textensions: ['.ts', '.tsx', '.mts', '.cts', '.js', '.mjs', '.cjs', '.json'],\n\t\t\textensionAlias: { '.js': ['.ts', '.tsx', '.js'], '.mjs': ['.mts', '.mjs'] },\n\t\t\tconditionNames: ['workerd', 'worker', 'browser', 'module', 'import', 'default'],\n\t\t\talias: worker.config.alias,\n\t\t},\n\t\tmodule: {\n\t\t\trules: [\n\t\t\t\t{\n\t\t\t\t\ttest: TYPESCRIPT_RE,\n\t\t\t\t\tloader: 'builtin:swc-loader',\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tjsc: {\n\t\t\t\t\t\t\tparser: { syntax: 'typescript', tsx: true, decorators: true },\n\t\t\t\t\t\t\ttarget: 'es2024',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'javascript/auto',\n\t\t\t\t},\n\t\t\t\t{ oneOf: getAssetRules(worker, textExtensions) },\n\t\t\t],\n\t\t},\n\t\tdevtool: 'source-map',\n\t\toptimization: {\n\t\t\t// follows wrangler's `minify`, since deploy can't minify an already bundled Worker; dev stays readable for debugging and HMR\n\t\t\tminimize: Boolean(worker.config.minify) && !hot,\n\t\t\t// a failed dev build must leave the last good bundle in place, since restarting another Worker reloads it from disk\n\t\t\temitOnErrors: false,\n\t\t},\n\t\tplugins,\n\t\tperformance: { hints: false },\n\t\twatchOptions: {\n\t\t\t// dev's generated entry is virtual and the bundle is written under .wrangler, so the watcher would see both as changes\n\t\t\tignored: /[/\\\\](?:\\.git|node_modules|\\.wrangler)[/\\\\]/,\n\t\t},\n\t\tstats: 'errors-warnings',\n\t\tinfrastructureLogging: compiler.options.infrastructureLogging,\n\t};\n\n\tif (pluginOptions.worker) {\n\t\tconfig = pluginOptions.worker(config, { name: worker.name }) ?? config;\n\t}\n\treturn { config, virtualModules: virtualModulesPlugin, additionalModules };\n}\n","import { existsSync } from 'node:fs';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\n\nimport { unstable_getVarsForDev } from 'wrangler';\n\nimport { IMPORTED_ASSETS_DIR, createWorkerConfig } from './worker-config.js';\n\nimport type { ResolvedWorker } from './config.js';\nimport type { CloudflarePluginOptions } from './options.js';\nimport type { Compiler, Stats } from '@rspack/core';\n\n// readConfig's file paths and bundling settings that rspack has already applied, so deploy must not apply them again. The\n// environment fields stay, since deploy checks --env against them and tags sibling environments with them\nconst OMITTED_CONFIG_KEYS = new Set([\n\t'configPath',\n\t'userConfigPath',\n\t'build',\n\t'define',\n\t'alias',\n\t'tsconfig',\n\t'find_additional_modules',\n\t'minify',\n\t'base_dir',\n\t'preserve_file_names',\n]);\n\n/** The Wrangler config `wrangler deploy` reads for the built Worker, with every path rebased onto the output directory. */\nexport function createOutputConfig(worker: ResolvedWorker) {\n\tconst rebase = (filePath: string) => path.relative(worker.outputDir, path.resolve(worker.rootDir, filePath)).replaceAll('\\\\', '/') || '.';\n\tconst config = Object.fromEntries(Object.entries(worker.config).filter(([key]) => !OMITTED_CONFIG_KEYS.has(key)));\n\t// readConfig always fills in `unsafe`, and wrangler warns about it being experimental even when empty\n\tif (worker.config.unsafe && Object.keys(worker.config.unsafe).length === 0) {\n\t\tdelete config.unsafe;\n\t}\n\n\t// wrangler's defaults already cover .wasm and .bin beside the bundle; custom binary rules have to come along\n\tconst binaryRules = worker.config.rules.filter(rule => rule.type === 'CompiledWasm' || rule.type === 'Data');\n\tconst bundled = worker.main\n\t\t? { main: 'index.js', no_bundle: true, rules: [{ type: 'ESModule', globs: ['**/*.js', '**/*.mjs'] }, ...binaryRules] }\n\t\t: { main: undefined };\n\n\treturn {\n\t\t...config,\n\t\t...bundled,\n\t\tassets: worker.assets ? { ...worker.config.assets, directory: rebase(worker.assets.directory) } : undefined,\n\t\tcontainers: worker.config.containers?.map((container) => {\n\t\t\tconst rebased = { ...container };\n\t\t\t// image is either a Dockerfile path or a registry reference; readConfig makes paths absolute, so only those need rebasing\n\t\t\tif (container.image && path.isAbsolute(container.image)) {\n\t\t\t\trebased.image = rebase(container.image);\n\t\t\t}\n\t\t\tif (container.image_build_context) {\n\t\t\t\trebased.image_build_context = rebase(container.image_build_context);\n\t\t\t}\n\t\t\treturn rebased;\n\t\t}),\n\t\tupload_source_maps: worker.config.upload_source_maps ?? true,\n\t};\n}\n\nasync function runCompiler(compiler: Compiler) {\n\ttry {\n\t\treturn await new Promise<Stats>((resolve, reject) => {\n\t\t\tcompiler.run((error, stats) => {\n\t\t\t\tif (error || !stats) {\n\t\t\t\t\treject(error ?? new Error('Worker build produced no stats'));\n\t\t\t\t} else {\n\t\t\t\t\tresolve(stats);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t} finally {\n\t\tawait new Promise<void>((resolve) => {\n\t\t\tcompiler.close(() => resolve());\n\t\t});\n\t}\n}\n\n/** The local secrets for this environment, written beside the build so `wrangler dev` can preview it like the Vite plugin's `vite preview`. */\nfunction createDevVars(worker: ResolvedWorker) {\n\tconst vars = unstable_getVarsForDev(worker.configPath, undefined, {}, worker.environment, true, worker.config.secrets);\n\tconst lines = Object.entries(vars).map(([key, binding]) => `${key}=${JSON.stringify(String(binding.value))}`);\n\treturn lines.length > 0 ? `${lines.join('\\n')}\\n` : undefined;\n}\n\n/** Bundles one Worker into its output directory beside the `wrangler.json` that deploys it, returning that config's path. */\nasync function buildWorker(compiler: Compiler, worker: ResolvedWorker, pluginOptions: CloudflarePluginOptions) {\n\tif (worker.main) {\n\t\tconst { config } = createWorkerConfig({\n\t\t\tcompiler,\n\t\t\tworker,\n\t\t\tpluginOptions,\n\t\t\toutputDir: worker.outputDir,\n\t\t\tentry: worker.main,\n\t\t\tmode: compiler.options.mode === 'production' ? 'production' : 'development',\n\t\t});\n\t\tconst workerCompiler = compiler.rspack.rspack(config);\n\t\tconst stats = await runCompiler(workerCompiler);\n\t\tif (stats.hasErrors()) {\n\t\t\tthrow new Error(`Worker \"${worker.name}\" build failed:\\n${stats.toString({ preset: 'errors-only', colors: false })}`);\n\t\t}\n\t} else {\n\t\tawait fs.rm(worker.outputDir, { recursive: true, force: true });\n\t\tawait fs.mkdir(worker.outputDir, { recursive: true });\n\t}\n\n\tconst outputConfigPath = path.join(worker.outputDir, 'wrangler.json');\n\tawait fs.writeFile(outputConfigPath, JSON.stringify(createOutputConfig(worker), null, '\\t'));\n\tconst devVars = createDevVars(worker);\n\tif (devVars) {\n\t\tawait fs.writeFile(path.join(worker.outputDir, '.dev.vars'), devVars);\n\t}\n\treturn outputConfigPath;\n}\n\n/** Moves assets the Worker imported into its assets directory, once the client build has emitted (and maybe cleaned) it. */\nexport async function copyImportedAssets(workers: ResolvedWorker[]) {\n\tfor (const worker of workers) {\n\t\tconst source = path.join(worker.outputDir, IMPORTED_ASSETS_DIR);\n\t\tif (!worker.assets || !existsSync(source)) {\n\t\t\tcontinue;\n\t\t}\n\t\tawait fs.cp(source, worker.assets.directory, { recursive: true });\n\t\tawait fs.rm(source, { recursive: true, force: true });\n\t}\n}\n\n/** Builds every Worker, entry first, and writes the redirect `wrangler deploy` follows to the built configs. */\nexport async function buildWorkers(options: { compiler: Compiler; workers: ResolvedWorker[]; pluginOptions: CloudflarePluginOptions; }) {\n\tconst { compiler, workers, pluginOptions } = options;\n\tconst [entry] = workers;\n\tif (!entry) {\n\t\treturn;\n\t}\n\tconst configPaths: string[] = [];\n\tfor (const worker of workers) {\n\t\tconfigPaths.push(await buildWorker(compiler, worker, pluginOptions));\n\t}\n\n\t// the same redirect @cloudflare/vite-plugin writes, so a plain `wrangler deploy` next to the user config deploys the build\n\tconst deployConfigPath = path.join(entry.rootDir, '.wrangler', 'deploy', 'config.json');\n\tconst relativeToDeploy = (filePath: string) => path.relative(path.dirname(deployConfigPath), filePath).replaceAll('\\\\', '/');\n\tconst [entryConfigPath, ...auxiliaryConfigPaths] = configPaths;\n\tawait fs.mkdir(path.dirname(deployConfigPath), { recursive: true });\n\tawait fs.writeFile(deployConfigPath, JSON.stringify({\n\t\tconfigPath: entryConfigPath && relativeToDeploy(entryConfigPath),\n\t\tauxiliaryWorkers: auxiliaryConfigPaths.map((configPath) => {\n\t\t\treturn { configPath: relativeToDeploy(configPath) };\n\t\t}),\n\t}));\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { convertToWranglerConfig, loadAndParseConfig } from '@cloudflare/config';\nimport { normalizeAndValidateConfig } from '@cloudflare/workers-utils';\nimport { unstable_readConfig } from 'wrangler';\n\nimport type {\n\tAuxiliaryWorkerOptions,\n\tCloudflarePluginOptions,\n\tWorkerConfig,\n\tWorkerConfigCustomizer,\n} from './options.js';\n\nconst CLOUDFLARE_CONFIG_FILE_NAME = 'cloudflare.config.ts';\nconst WRANGLER_CONFIG_FILE_NAMES = ['wrangler.jsonc', 'wrangler.json', 'wrangler.toml'];\n\nexport interface ResolvedWorker {\n\tconfig: WorkerConfig;\n\tconfigPath: string;\n\t/** The config file and every local file it imports, any of which changing means the config must be read again. */\n\tconfigFiles: string[];\n\tenvironment: string | undefined;\n\tname: string;\n\t/** Undefined for assets-only projects, which deploy static files without a Worker. */\n\tmain: string | undefined;\n\t/** Directory holding the Wrangler config; relative paths in the config resolve against it. */\n\trootDir: string;\n\tassets: {\n\t\tdirectory: string;\n\t\tbinding: string | undefined;\n\t} | undefined;\n\toutputDir: string;\n}\n\nfunction findConfigPath(context: string, configPath: string | undefined) {\n\tif (configPath) {\n\t\treturn path.resolve(context, configPath);\n\t}\n\t// projects often point rspack's context at a source folder, so walk up like wrangler does\n\tlet directory = context;\n\twhile (true) {\n\t\tconst cloudflareConfigPath = path.join(directory, CLOUDFLARE_CONFIG_FILE_NAME);\n\t\tconst wranglerConfigPath = WRANGLER_CONFIG_FILE_NAMES.map(fileName => path.join(directory, fileName)).find(candidate => fs.existsSync(candidate));\n\t\tif (fs.existsSync(cloudflareConfigPath)) {\n\t\t\t// mid-migration projects can have both, and quietly picking one would leave the other's edits ignored\n\t\t\tif (wranglerConfigPath) {\n\t\t\t\tthrow new Error(`Found both ${cloudflareConfigPath} and ${wranglerConfigPath}. Remove one, or choose one with the \\`configPath\\` option.`);\n\t\t\t}\n\t\t\treturn cloudflareConfigPath;\n\t\t}\n\t\tif (wranglerConfigPath) {\n\t\t\treturn wranglerConfigPath;\n\t\t}\n\t\tconst parent = path.dirname(directory);\n\t\tif (parent === directory) {\n\t\t\tthrow new Error(`No Cloudflare config found in ${context} or its parents. Looked for ${[CLOUDFLARE_CONFIG_FILE_NAME, ...WRANGLER_CONFIG_FILE_NAMES].join(', ')}.`);\n\t\t}\n\t\tdirectory = parent;\n\t}\n}\n\n/** Loads `cloudflare.config.ts` into the same Config wrangler reads from its own files, the way `wrangler --experimental-new-config` does. */\nasync function readCloudflareConfig(configPath: string, mode: string | undefined, clientOutputPath: string | undefined) {\n\tconst { result, dependencies } = await loadAndParseConfig(configPath, { isPreview: false, mode });\n\tif (!result.success) {\n\t\tconst issues = result.error.issues.map(issue => ` - ${issue.path.map(String).join('.') || '(root)'}: ${issue.message}`);\n\t\tthrow new Error(`Invalid ${configPath}:\\n${issues.join('\\n')}`);\n\t}\n\tif (!result.data.worker) {\n\t\tthrow new Error(`${configPath} must define a Worker using the \\`worker\\` property.`);\n\t}\n\tconst rawConfig = convertToWranglerConfig(result.data);\n\t// cloudflare.config.ts leaves the assets directory to the bundler, which Vite fills with its client build output\n\tif (rawConfig.assets && clientOutputPath) {\n\t\trawConfig.assets.directory = clientOutputPath;\n\t}\n\tconst { config, diagnostics } = normalizeAndValidateConfig(rawConfig, configPath, configPath, {}, true);\n\tif (diagnostics.hasErrors()) {\n\t\tthrow new Error(diagnostics.renderErrors());\n\t}\n\tif (diagnostics.hasWarnings()) {\n\t\tconsole.warn(diagnostics.renderWarnings());\n\t}\n\treturn { config, configFiles: [...new Set([configPath, ...dependencies])] };\n}\n\nasync function readConfig(configPath: string, environment: string | undefined, clientOutputPath: string | undefined) {\n\tif (path.basename(configPath) === CLOUDFLARE_CONFIG_FILE_NAME) {\n\t\t// cloudflare.config.ts has no Wrangler environments; it reads the environment as its mode instead\n\t\treturn readCloudflareConfig(configPath, environment, clientOutputPath);\n\t}\n\t// an explicit path skips wrangler's .wrangler/deploy redirect, which would otherwise point dev at our own build output\n\tconst config = unstable_readConfig({ config: configPath, env: environment }, { preserveOriginalMain: true });\n\treturn { config, configFiles: [configPath] };\n}\n\nfunction isInside(parent: string, child: string) {\n\tconst relative = path.relative(parent, child);\n\treturn relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** Deep-merges plain objects so an override like `{ vars: { A: '1' } }` keeps the other vars; arrays are replaced. */\nfunction mergeConfig(target: WorkerConfig | Record<string, unknown>, overrides: Partial<WorkerConfig> | Record<string, unknown>) {\n\tfor (const [key, value] of Object.entries(overrides)) {\n\t\tconst existing: unknown = Reflect.get(target, key);\n\t\tif (isPlainObject(existing) && isPlainObject(value)) {\n\t\t\tmergeConfig(existing, value);\n\t\t} else {\n\t\t\tReflect.set(target, key, value);\n\t\t}\n\t}\n}\n\nfunction applyCustomizer(config: WorkerConfig, customizer: WorkerConfigCustomizer | undefined) {\n\tif (!customizer) {\n\t\treturn;\n\t}\n\tconst overrides = typeof customizer === 'function' ? customizer(config) : customizer;\n\tif (overrides) {\n\t\tmergeConfig(config, overrides);\n\t}\n}\n\n/** Reads a Worker's config, with `clientOutputPath` (rspack's `output.path`) serving as the assets directory `cloudflare.config.ts` can't name. */\nexport async function resolveWorker(context: string, options: CloudflarePluginOptions, clientOutputPath?: string): Promise<ResolvedWorker> {\n\tconst configPath = findConfigPath(context, options.configPath);\n\tconst environment = options.environment ?? process.env.CLOUDFLARE_ENV;\n\tconst { config, configFiles } = await readConfig(configPath, environment, clientOutputPath);\n\tapplyCustomizer(config, options.config);\n\tconst rootDir = path.dirname(configPath);\n\n\tif (!config.main && !config.assets?.directory) {\n\t\tthrow new Error(`${configPath} needs a \\`main\\` Worker entry, or an \\`assets.directory\\` for an assets-only project.`);\n\t}\n\tif (!config.name) {\n\t\tthrow new Error(`${configPath} has no \\`name\\`.`);\n\t}\n\n\tconst assets = config.assets?.directory\n\t\t? { directory: path.resolve(rootDir, config.assets.directory), binding: config.assets.binding }\n\t\t: undefined;\n\tconst outputDir = path.resolve(rootDir, options.outputDir ?? path.join('dist', config.name));\n\n\t// anything in the assets directory is publicly served, so the Worker bundle can't live there\n\tif (assets && isInside(assets.directory, outputDir)) {\n\t\tthrow new Error(`outputDir (${outputDir}) is inside the assets directory (${assets.directory}); the Worker bundle would be publicly served.`);\n\t}\n\n\treturn {\n\t\tconfig,\n\t\tconfigPath,\n\t\tconfigFiles,\n\t\tenvironment,\n\t\tname: config.name,\n\t\tmain: config.main ? path.resolve(rootDir, config.main) : undefined,\n\t\trootDir,\n\t\tassets,\n\t\toutputDir,\n\t};\n}\n\n/** Resolves an auxiliary Worker, which only the entry Worker's service bindings reach, so it can't serve assets. */\nasync function resolveAuxiliaryWorker(context: string, options: CloudflarePluginOptions, auxiliary: AuxiliaryWorkerOptions, clientOutputPath: string | undefined) {\n\tconst worker = await resolveWorker(context, { ...auxiliary, environment: options.environment }, clientOutputPath);\n\tif (!worker.main) {\n\t\tthrow new Error(`Auxiliary Worker config ${worker.configPath} needs a \\`main\\` entry.`);\n\t}\n\tif (worker.assets) {\n\t\tthrow new Error(`Auxiliary Worker \"${worker.name}\" has \\`assets\\`, which only the entry Worker supports.`);\n\t}\n\treturn worker;\n}\n\n/** A resolver per Worker, entry first, so a config change can re-read just the Worker it belongs to. */\nexport function getWorkerResolvers(context: string, options: CloudflarePluginOptions, clientOutputPath: string | undefined): (() => Promise<ResolvedWorker>)[] {\n\treturn [\n\t\t() => resolveWorker(context, options, clientOutputPath),\n\t\t...(options.auxiliaryWorkers ?? []).map(auxiliary => () => resolveAuxiliaryWorker(context, options, auxiliary, clientOutputPath)),\n\t];\n}\n","import { createRequire } from 'node:module';\n\nimport type * as Miniflare from 'miniflare';\n\n// wrangler (a peer dependency) builds the Miniflare options, so run them with the Miniflare that version of wrangler ships\nconst requireFromWrangler = createRequire(import.meta.resolve('wrangler'));\n\nexport const miniflare = requireFromWrangler('miniflare') as typeof Miniflare;\n","export const REDIRECTS_VERSION = 1;\nexport const HEADERS_VERSION = 2;\n\nexport const PERMITTED_STATUS_CODES = new Set([200, 301, 302, 303, 307, 308]);\nexport const HEADER_SEPARATOR = \":\";\nexport const MAX_LINE_LENGTH = 2000;\nexport const MAX_HEADER_RULES = 100;\nexport const MAX_DYNAMIC_REDIRECT_RULES = 100;\nexport const MAX_STATIC_REDIRECT_RULES = 2000;\nexport const UNSET_OPERATOR = \"! \";\n\nexport const SPLAT_REGEX = /\\*/g;\nexport const PLACEHOLDER_REGEX = /:[A-Za-z]\\w*/g;\n\n/** Max number of rules in `run_worker_first` */\nexport const MAX_ROUTES_RULES = 100;\n/** Max char length of each rule in `run_worker_first` */\nexport const MAX_ROUTES_RULE_LENGTH = 100;\n","import { relative } from \"node:path\";\nimport {\n\tHEADERS_VERSION,\n\tPLACEHOLDER_REGEX,\n\tREDIRECTS_VERSION,\n\tSPLAT_REGEX,\n} from \"./constants\";\nimport type {\n\tAssetConfig,\n\tMetadataHeaders,\n\tMetadataRedirects,\n\tMetadataStaticRedirects,\n} from \"../types\";\nimport type { Logger, ParsedHeaders, ParsedRedirects } from \"./types\";\n\nexport function constructRedirects({\n\tredirects,\n\tredirectsFile,\n\tlogger,\n}: {\n\tredirects?: ParsedRedirects;\n\tredirectsFile?: string;\n\tlogger: Logger;\n}): Pick<AssetConfig, \"redirects\"> {\n\tif (!redirects) {\n\t\treturn {};\n\t}\n\n\tconst num_valid = redirects.rules.length;\n\tconst num_invalid = redirects.invalid.length;\n\n\t// exhaustive check, since we could not have parsed `redirects` out of\n\t// a non-existing redirects file\n\tconst redirectsRelativePath = redirectsFile\n\t\t? relative(process.cwd(), redirectsFile)\n\t\t: \"\";\n\n\tlogger.log(\n\t\t`✨ Parsed ${num_valid} valid redirect rule${num_valid === 1 ? \"\" : \"s\"}.`\n\t);\n\n\tif (num_invalid > 0) {\n\t\tlet invalidRedirectRulesList = ``;\n\n\t\tfor (const { line, lineNumber, message } of redirects.invalid) {\n\t\t\tinvalidRedirectRulesList += `▶︎ ${message}\\n`;\n\n\t\t\tif (line) {\n\t\t\t\tinvalidRedirectRulesList += ` at ${redirectsRelativePath}${lineNumber ? `:${lineNumber}` : \"\"} | ${line}\\n\\n`;\n\t\t\t}\n\t\t}\n\n\t\tlogger.warn(\n\t\t\t`Found ${num_invalid} invalid redirect rule${num_invalid === 1 ? \"\" : \"s\"}:\\n` +\n\t\t\t\t`${invalidRedirectRulesList}`\n\t\t);\n\t}\n\n\t/* Better to return no Redirects object at all than one with empty rules */\n\tif (num_valid === 0) {\n\t\treturn {};\n\t}\n\n\tconst staticRedirects: MetadataStaticRedirects = {};\n\tconst dynamicRedirects: MetadataRedirects = {};\n\tlet canCreateStaticRule = true;\n\tfor (const rule of redirects.rules) {\n\t\tif (!rule.from.match(SPLAT_REGEX) && !rule.from.match(PLACEHOLDER_REGEX)) {\n\t\t\tif (canCreateStaticRule) {\n\t\t\t\tstaticRedirects[rule.from] = {\n\t\t\t\t\tstatus: rule.status,\n\t\t\t\t\tto: rule.to,\n\t\t\t\t\tlineNumber: rule.lineNumber,\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tlogger.info(\n\t\t\t\t\t`The redirect rule ${rule.from} → ${rule.status} ${rule.to} could be made more performant by bringing it above any lines with splats or placeholders.`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tdynamicRedirects[rule.from] = { status: rule.status, to: rule.to };\n\t\tcanCreateStaticRule = false;\n\t}\n\n\treturn {\n\t\tredirects: {\n\t\t\tversion: REDIRECTS_VERSION,\n\t\t\tstaticRules: staticRedirects,\n\t\t\trules: dynamicRedirects,\n\t\t},\n\t};\n}\n\nexport function constructHeaders({\n\theaders,\n\theadersFile,\n\tlogger,\n}: {\n\theaders?: ParsedHeaders;\n\theadersFile?: string;\n\tlogger: Logger;\n}): Pick<AssetConfig, \"headers\"> {\n\tif (!headers) {\n\t\treturn {};\n\t}\n\n\tconst num_valid = headers.rules.length;\n\tconst num_invalid = headers.invalid.length;\n\n\t// exhaustive check, since we could not have parsed `headers` out of\n\t// a non-existing headers file\n\tconst headersRelativePath = headersFile\n\t\t? relative(process.cwd(), headersFile)\n\t\t: \"\";\n\n\tlogger.log(\n\t\t`✨ Parsed ${num_valid} valid header rule${num_valid === 1 ? \"\" : \"s\"}.`\n\t);\n\n\tif (num_invalid > 0) {\n\t\tlet invalidHeaderRulesList = ``;\n\n\t\tfor (const { line, lineNumber, message } of headers.invalid) {\n\t\t\tinvalidHeaderRulesList += `▶︎ ${message}\\n`;\n\n\t\t\tif (line) {\n\t\t\t\tinvalidHeaderRulesList += ` at ${headersRelativePath}${lineNumber ? `:${lineNumber}` : \"\"} | ${line}\\n\\n`;\n\t\t\t}\n\t\t}\n\n\t\tlogger.warn(\n\t\t\t`Found ${num_invalid} invalid header rule${num_invalid === 1 ? \"\" : \"s\"}:\\n` +\n\t\t\t\t`${invalidHeaderRulesList}`\n\t\t);\n\t}\n\n\t/* Better to return no Headers object at all than one with empty rules */\n\tif (num_valid === 0) {\n\t\treturn {};\n\t}\n\n\tconst rules: MetadataHeaders = {};\n\tfor (const rule of headers.rules) {\n\t\tconst configuredRule: MetadataHeaders[string] = {};\n\n\t\tif (Object.keys(rule.headers).length) {\n\t\t\tconfiguredRule.set = rule.headers;\n\t\t}\n\t\tif (rule.unsetHeaders.length) {\n\t\t\tconfiguredRule.unset = rule.unsetHeaders;\n\t\t}\n\n\t\trules[rule.path] = configuredRule;\n\t}\n\n\treturn {\n\t\theaders: {\n\t\t\tversion: HEADERS_VERSION,\n\t\t\trules,\n\t\t},\n\t};\n}\n","export const extractPathname = (\n\tpath = \"/\",\n\tincludeSearch: boolean,\n\tincludeHash: boolean\n): string => {\n\tif (!path.startsWith(\"/\")) {\n\t\tpath = `/${path}`;\n\t}\n\tconst url = new URL(`//${path}`, \"relative://\");\n\treturn `${url.pathname}${includeSearch ? url.search : \"\"}${\n\t\tincludeHash ? url.hash : \"\"\n\t}`;\n};\n\nconst URL_REGEX = /^https:\\/\\/+(?<host>[^/]+)\\/?(?<path>.*)/;\nconst HOST_WITH_PORT_REGEX = /.*:\\d+$/;\nconst PATH_REGEX = /^\\//;\n\nexport const validateUrl = (\n\ttoken: string,\n\tonlyRelative = false,\n\tdisallowPorts = false,\n\tincludeSearch = false,\n\tincludeHash = false\n): [undefined, string] | [string, undefined] => {\n\tconst host = URL_REGEX.exec(token);\n\tif (host && host.groups && host.groups.host) {\n\t\tif (onlyRelative) {\n\t\t\treturn [\n\t\t\t\tundefined,\n\t\t\t\t`Only relative URLs are allowed. Skipping absolute URL ${token}.`,\n\t\t\t];\n\t\t}\n\n\t\tif (disallowPorts && host.groups.host.match(HOST_WITH_PORT_REGEX)) {\n\t\t\treturn [\n\t\t\t\tundefined,\n\t\t\t\t`Specifying ports is not supported. Skipping absolute URL ${token}.`,\n\t\t\t];\n\t\t}\n\n\t\treturn [\n\t\t\t`https://${host.groups.host}${extractPathname(\n\t\t\t\thost.groups.path,\n\t\t\t\tincludeSearch,\n\t\t\t\tincludeHash\n\t\t\t)}`,\n\t\t\tundefined,\n\t\t];\n\t} else {\n\t\tif (!token.startsWith(\"/\") && onlyRelative) {\n\t\t\ttoken = `/${token}`;\n\t\t}\n\n\t\tconst path = PATH_REGEX.exec(token);\n\t\tif (path) {\n\t\t\ttry {\n\t\t\t\treturn [extractPathname(token, includeSearch, includeHash), undefined];\n\t\t\t} catch {\n\t\t\t\treturn [undefined, `Error parsing URL segment ${token}. Skipping.`];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn [\n\t\tundefined,\n\t\tonlyRelative\n\t\t\t? \"URLs should begin with a forward-slash.\"\n\t\t\t: 'URLs should either be relative (e.g. begin with a forward-slash), or use HTTPS (e.g. begin with \"https://\").',\n\t];\n};\n\nexport function urlHasHost(token: string): boolean {\n\tconst host = URL_REGEX.exec(token);\n\treturn Boolean(host && host.groups && host.groups.host);\n}\n","import {\n\tHEADER_SEPARATOR,\n\tMAX_HEADER_RULES,\n\tMAX_LINE_LENGTH,\n\tSPLAT_REGEX,\n\tUNSET_OPERATOR,\n} from \"./constants\";\nimport { validateUrl } from \"./validateURL\";\nimport type { HeadersRule, InvalidHeadersRule, ParsedHeaders } from \"./types\";\n\n// Not strictly necessary to check for all protocols-like beginnings, since _technically_ that could be a legit header (e.g. name=http, value=://I'm a value).\n// But we're checking here since some people might be caught out and it'll help 99.9% of people who get it wrong.\n// We do the proper validation in `validateUrl` anyway :)\nconst LINE_IS_PROBABLY_A_PATH = new RegExp(/^([^\\s]+:\\/\\/|^\\/)/);\n\nexport function parseHeaders(\n\tinput: string,\n\t{\n\t\tmaxRules = MAX_HEADER_RULES,\n\t\tmaxLineLength = MAX_LINE_LENGTH,\n\t}: { maxRules?: number; maxLineLength?: number } = {}\n): ParsedHeaders {\n\tconst lines = input.split(\"\\n\");\n\tconst rules: HeadersRule[] = [];\n\tconst invalid: InvalidHeadersRule[] = [];\n\n\tlet rule: (HeadersRule & { line: string }) | undefined = undefined;\n\t// When a path line is rejected (invalid URL, multiple wildcards, etc.),\n\t// we silently skip subsequent header lines until the next path line\n\t// rather than emitting confusing \"Path should come before header\" errors.\n\tlet skipUntilNextPath = false;\n\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tconst line = (lines[i] || \"\").trim();\n\t\tif (line.length === 0 || line.startsWith(\"#\")) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (line.length > maxLineLength) {\n\t\t\tinvalid.push({\n\t\t\t\tmessage: `Ignoring line ${\n\t\t\t\t\ti + 1\n\t\t\t\t} as it exceeds the maximum allowed length of ${maxLineLength}.`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (LINE_IS_PROBABLY_A_PATH.test(line)) {\n\t\t\tskipUntilNextPath = false;\n\n\t\t\tif (rules.length >= maxRules) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tmessage: `Maximum number of rules supported is ${maxRules}. Skipping remaining ${\n\t\t\t\t\t\tlines.length - i\n\t\t\t\t\t} lines of file.`,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (rule) {\n\t\t\t\tif (isValidRule(rule)) {\n\t\t\t\t\trules.push({\n\t\t\t\t\t\tpath: rule.path,\n\t\t\t\t\t\theaders: rule.headers,\n\t\t\t\t\t\tunsetHeaders: rule.unsetHeaders,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tinvalid.push({\n\t\t\t\t\t\tline: rule.line,\n\t\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\t\tmessage: \"No headers specified\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst [path, pathError] = validateUrl(line, false, true);\n\t\t\tif (pathError) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tline,\n\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\tmessage: pathError,\n\t\t\t\t});\n\t\t\t\trule = undefined;\n\t\t\t\tskipUntilNextPath = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst wildcardError = validateNoMultipleWildcards(path as string);\n\t\t\tif (wildcardError) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tline,\n\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\tmessage: wildcardError,\n\t\t\t\t});\n\t\t\t\trule = undefined;\n\t\t\t\tskipUntilNextPath = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trule = {\n\t\t\t\tpath: path as string,\n\t\t\t\tline,\n\t\t\t\theaders: {},\n\t\t\t\tunsetHeaders: [],\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (skipUntilNextPath) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!line.includes(HEADER_SEPARATOR)) {\n\t\t\tif (!rule) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tline,\n\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\tmessage: \"Expected a path beginning with at least one forward-slash\",\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (line.trim().startsWith(UNSET_OPERATOR)) {\n\t\t\t\t\trule.unsetHeaders.push(line.trim().replace(UNSET_OPERATOR, \"\"));\n\t\t\t\t} else {\n\t\t\t\t\tinvalid.push({\n\t\t\t\t\t\tline,\n\t\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"Expected a colon-separated header pair (e.g. name: value)\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [rawName, ...rawValue] = line.split(HEADER_SEPARATOR);\n\t\tconst name = (rawName || \"\").trim().toLowerCase();\n\n\t\tif (name.includes(\" \")) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: \"Header name cannot include spaces\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst value = rawValue.join(HEADER_SEPARATOR).trim();\n\n\t\tif (name === \"\") {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: \"No header name specified\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (value === \"\") {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: \"No header value specified\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!rule) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: `Path should come before header (${name}: ${value})`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst existingValues = rule.headers[name];\n\t\trule.headers[name] = existingValues ? `${existingValues}, ${value}` : value;\n\t}\n\n\tif (rule) {\n\t\tif (isValidRule(rule)) {\n\t\t\trules.push({\n\t\t\t\tpath: rule.path,\n\t\t\t\theaders: rule.headers,\n\t\t\t\tunsetHeaders: rule.unsetHeaders,\n\t\t\t});\n\t\t} else {\n\t\t\tinvalid.push({ line: rule.line, message: \"No headers specified\" });\n\t\t}\n\t}\n\n\treturn {\n\t\trules,\n\t\tinvalid,\n\t};\n}\n\nfunction isValidRule(rule: HeadersRule) {\n\treturn Object.keys(rule.headers).length > 0 || rule.unsetHeaders.length > 0;\n}\n\n/**\n * At runtime, `*` wildcards are converted to `:splat` placeholders. This means\n * a path with multiple wildcards, or a wildcard combined with an explicit\n * `:splat` placeholder, would result in duplicate `:splat` parameters which is\n * unsupported.\n */\nfunction validateNoMultipleWildcards(path: string): string | undefined {\n\tconst wildcardCount = (path.match(SPLAT_REGEX) ?? []).length;\n\tconst hasSplatPlaceholder = /:splat(?!\\w)/.test(path);\n\n\tif (wildcardCount > 1) {\n\t\treturn `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path}.`;\n\t}\n\n\tif (wildcardCount > 0 && hasSplatPlaceholder) {\n\t\treturn `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path}.`;\n\t}\n\n\treturn undefined;\n}\n","import {\n\tMAX_DYNAMIC_REDIRECT_RULES,\n\tMAX_LINE_LENGTH,\n\tMAX_STATIC_REDIRECT_RULES,\n\tPERMITTED_STATUS_CODES,\n\tPLACEHOLDER_REGEX,\n\tSPLAT_REGEX,\n} from \"./constants\";\nimport { urlHasHost, validateUrl } from \"./validateURL\";\nimport type { AssetConfig } from \"../types\";\nimport type {\n\tInvalidRedirectRule,\n\tParsedRedirects,\n\tRedirectLine,\n\tRedirectRule,\n} from \"./types\";\n\nexport function parseRedirects(\n\tinput: string,\n\t{\n\t\thtmlHandling = undefined,\n\t\tmaxStaticRules = MAX_STATIC_REDIRECT_RULES,\n\t\tmaxDynamicRules = MAX_DYNAMIC_REDIRECT_RULES,\n\t\tmaxLineLength = MAX_LINE_LENGTH,\n\t}: {\n\t\thtmlHandling?: AssetConfig[\"html_handling\"];\n\t\tmaxStaticRules?: number;\n\t\tmaxDynamicRules?: number;\n\t\tmaxLineLength?: number;\n\t} = {}\n): ParsedRedirects {\n\tconst lines = input.split(\"\\n\");\n\tconst rules: RedirectRule[] = [];\n\tconst seen_paths = new Set<string>();\n\tconst invalid: InvalidRedirectRule[] = [];\n\n\tlet staticRules = 0;\n\tlet dynamicRules = 0;\n\tlet canCreateStaticRule = true;\n\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tconst line = (lines[i] || \"\").trim();\n\t\tif (line.length === 0 || line.startsWith(\"#\")) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (line.length > maxLineLength) {\n\t\t\tinvalid.push({\n\t\t\t\tmessage: `Ignoring line ${\n\t\t\t\t\ti + 1\n\t\t\t\t} as it exceeds the maximum allowed length of ${maxLineLength}.`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Handle inline comments: strip off from the first `#` token that starts a comment, but not URL fragments.\n\t\t// This allows `/a /b#fragment` but strips `/a /b # comment`\n\t\tconst tokens = line.replace(/\\s+#.*$/, \"\").split(/\\s+/);\n\n\t\tif (tokens.length < 2 || tokens.length > 3) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: `Expected exactly 2 or 3 whitespace-separated tokens. Got ${tokens.length}.`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [str_from, str_to, str_status = \"302\"] = tokens as RedirectLine;\n\n\t\tconst fromResult = validateUrl(str_from, true, true, false, false);\n\t\tif (fromResult[0] === undefined) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: fromResult[1],\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst from = fromResult[0];\n\n\t\tif (\n\t\t\tcanCreateStaticRule &&\n\t\t\t!from.match(SPLAT_REGEX) &&\n\t\t\t!from.match(PLACEHOLDER_REGEX)\n\t\t) {\n\t\t\tstaticRules += 1;\n\n\t\t\tif (staticRules > maxStaticRules) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tmessage: `Maximum number of static rules supported is ${maxStaticRules}. Skipping line.`,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t} else {\n\t\t\tdynamicRules += 1;\n\t\t\tcanCreateStaticRule = false;\n\n\t\t\tif (dynamicRules > maxDynamicRules) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tmessage: `Maximum number of dynamic rules supported is ${maxDynamicRules}. Skipping remaining ${\n\t\t\t\t\t\tlines.length - i\n\t\t\t\t\t} lines of file.`,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tconst toResult = validateUrl(str_to, false, false, true, true);\n\t\tif (toResult[0] === undefined) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: toResult[1],\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst to = toResult[0];\n\n\t\tconst status = Number(str_status);\n\t\tif (isNaN(status) || !PERMITTED_STATUS_CODES.has(status)) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: `Valid status codes are 200, 301, 302 (default), 303, 307, or 308. Got ${str_status}.`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Here we reject two patterns:\n\t\t// 1. `/* /index.html` Is always rejected.\n\t\t// 2. `/ /index` Is rejected when HTML handling is enabled.\n\t\t// Allowing the redirect in other cases will cause TOO_MANY_REDIRECTS errors as the asset Worker will\n\t\t// redirect it back to `/` by removing the `/index.html`.\n\t\t// We only want to run this on relative URLs.\n\t\tconst hasRelativePath = !urlHasHost(to);\n\t\tconst hasWildcardToIndex =\n\t\t\tfrom.endsWith(\"/*\") && /\\/index(.html)?$/.test(to);\n\t\tconst hasRootToIndex = from.endsWith(\"/\") && /\\/index(.html)?$/.test(to);\n\t\tconst hasHTMLHandling = htmlHandling !== \"none\"; // HTML handling is enabled by default.\n\t\tif (\n\t\t\thasRelativePath &&\n\t\t\t(hasWildcardToIndex || (hasRootToIndex && hasHTMLHandling))\n\t\t) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Infinite loop detected in this rule and has been ignored. This will cause a redirect to strip `.html` or `/index` and end up triggering this rule again. Please fix or remove this rule to silence this warning.\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (seen_paths.has(from)) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: `Ignoring duplicate rule for path ${from}.`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tseen_paths.add(from);\n\n\t\tif (status === 200) {\n\t\t\tif (urlHasHost(to)) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tline,\n\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\tmessage: `Proxy (200) redirects can only point to relative paths. Got ${to}`,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\trules.push({ from, to, status, lineNumber: i + 1 });\n\t}\n\n\treturn {\n\t\trules,\n\t\tinvalid,\n\t};\n}\n","// A simple implementation of make-array\nfunction makeArray (subject) {\n return Array.isArray(subject)\n ? subject\n : [subject]\n}\n\nconst EMPTY = ''\nconst SPACE = ' '\nconst ESCAPE = '\\\\'\nconst REGEX_TEST_BLANK_LINE = /^\\s+$/\nconst REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\\\]|^)\\\\$/\nconst REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\\\!/\nconst REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\\\#/\nconst REGEX_SPLITALL_CRLF = /\\r?\\n/g\n// /foo,\n// ./foo,\n// ../foo,\n// .\n// ..\nconst REGEX_TEST_INVALID_PATH = /^\\.*\\/|^\\.+$/\n\nconst SLASH = '/'\n\n// Do not use ternary expression here, since \"istanbul ignore next\" is buggy\nlet TMP_KEY_IGNORE = 'node-ignore'\n/* istanbul ignore else */\nif (typeof Symbol !== 'undefined') {\n TMP_KEY_IGNORE = Symbol.for('node-ignore')\n}\nconst KEY_IGNORE = TMP_KEY_IGNORE\n\nconst define = (object, key, value) =>\n Object.defineProperty(object, key, {value})\n\nconst REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g\n\nconst RETURN_FALSE = () => false\n\n// Sanitize the range of a regular expression\n// The cases are complicated, see test cases for details\nconst sanitizeRange = range => range.replace(\n REGEX_REGEXP_RANGE,\n (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0)\n ? match\n // Invalid range (out of order) which is ok for gitignore rules but\n // fatal for JavaScript regular expression, so eliminate it.\n : EMPTY\n)\n\n// See fixtures #59\nconst cleanRangeBackSlash = slashes => {\n const {length} = slashes\n return slashes.slice(0, length - length % 2)\n}\n\n// > If the pattern ends with a slash,\n// > it is removed for the purpose of the following description,\n// > but it would only find a match with a directory.\n// > In other words, foo/ will match a directory foo and paths underneath it,\n// > but will not match a regular file or a symbolic link foo\n// > (this is consistent with the way how pathspec works in general in Git).\n// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`'\n// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call\n// you could use option `mark: true` with `glob`\n\n// '`foo/`' should not continue with the '`..`'\nconst REPLACERS = [\n\n [\n // remove BOM\n // TODO:\n // Other similar zero-width characters?\n /^\\uFEFF/,\n () => EMPTY\n ],\n\n // > Trailing spaces are ignored unless they are quoted with backslash (\"\\\")\n [\n // (a\\ ) -> (a )\n // (a ) -> (a)\n // (a \\ ) -> (a )\n /\\\\?\\s+$/,\n match => match.indexOf('\\\\') === 0\n ? SPACE\n : EMPTY\n ],\n\n // replace (\\ ) with ' '\n [\n /\\\\\\s/g,\n () => SPACE\n ],\n\n // Escape metacharacters\n // which is written down by users but means special for regular expressions.\n\n // > There are 12 characters with special meanings:\n // > - the backslash \\,\n // > - the caret ^,\n // > - the dollar sign $,\n // > - the period or dot .,\n // > - the vertical bar or pipe symbol |,\n // > - the question mark ?,\n // > - the asterisk or star *,\n // > - the plus sign +,\n // > - the opening parenthesis (,\n // > - the closing parenthesis ),\n // > - and the opening square bracket [,\n // > - the opening curly brace {,\n // > These special characters are often called \"metacharacters\".\n [\n /[\\\\$.|*+(){^]/g,\n match => `\\\\${match}`\n ],\n\n [\n // > a question mark (?) matches a single character\n /(?!\\\\)\\?/g,\n () => '[^/]'\n ],\n\n // leading slash\n [\n\n // > A leading slash matches the beginning of the pathname.\n // > For example, \"/*.c\" matches \"cat-file.c\" but not \"mozilla-sha1/sha1.c\".\n // A leading slash matches the beginning of the pathname\n /^\\//,\n () => '^'\n ],\n\n // replace special metacharacter slash after the leading slash\n [\n /\\//g,\n () => '\\\\/'\n ],\n\n [\n // > A leading \"**\" followed by a slash means match in all directories.\n // > For example, \"**/foo\" matches file or directory \"foo\" anywhere,\n // > the same as pattern \"foo\".\n // > \"**/foo/bar\" matches file or directory \"bar\" anywhere that is directly\n // > under directory \"foo\".\n // Notice that the '*'s have been replaced as '\\\\*'\n /^\\^*\\\\\\*\\\\\\*\\\\\\//,\n\n // '**/foo' <-> 'foo'\n () => '^(?:.*\\\\/)?'\n ],\n\n // starting\n [\n // there will be no leading '/'\n // (which has been replaced by section \"leading slash\")\n // If starts with '**', adding a '^' to the regular expression also works\n /^(?=[^^])/,\n function startingReplacer () {\n // If has a slash `/` at the beginning or middle\n return !/\\/(?!$)/.test(this)\n // > Prior to 2.22.1\n // > If the pattern does not contain a slash /,\n // > Git treats it as a shell glob pattern\n // Actually, if there is only a trailing slash,\n // git also treats it as a shell glob pattern\n\n // After 2.22.1 (compatible but clearer)\n // > If there is a separator at the beginning or middle (or both)\n // > of the pattern, then the pattern is relative to the directory\n // > level of the particular .gitignore file itself.\n // > Otherwise the pattern may also match at any level below\n // > the .gitignore level.\n ? '(?:^|\\\\/)'\n\n // > Otherwise, Git treats the pattern as a shell glob suitable for\n // > consumption by fnmatch(3)\n : '^'\n }\n ],\n\n // two globstars\n [\n // Use lookahead assertions so that we could match more than one `'/**'`\n /\\\\\\/\\\\\\*\\\\\\*(?=\\\\\\/|$)/g,\n\n // Zero, one or several directories\n // should not use '*', or it will be replaced by the next replacer\n\n // Check if it is not the last `'/**'`\n (_, index, str) => index + 6 < str.length\n\n // case: /**/\n // > A slash followed by two consecutive asterisks then a slash matches\n // > zero or more directories.\n // > For example, \"a/**/b\" matches \"a/b\", \"a/x/b\", \"a/x/y/b\" and so on.\n // '/**/'\n ? '(?:\\\\/[^\\\\/]+)*'\n\n // case: /**\n // > A trailing `\"/**\"` matches everything inside.\n\n // #21: everything inside but it should not include the current folder\n : '\\\\/.+'\n ],\n\n // normal intermediate wildcards\n [\n // Never replace escaped '*'\n // ignore rule '\\*' will match the path '*'\n\n // 'abc.*/' -> go\n // 'abc.*' -> skip this rule,\n // coz trailing single wildcard will be handed by [trailing wildcard]\n /(^|[^\\\\]+)(\\\\\\*)+(?=.+)/g,\n\n // '*.js' matches '.js'\n // '*.js' doesn't match 'abc'\n (_, p1, p2) => {\n // 1.\n // > An asterisk \"*\" matches anything except a slash.\n // 2.\n // > Other consecutive asterisks are considered regular asterisks\n // > and will match according to the previous rules.\n const unescaped = p2.replace(/\\\\\\*/g, '[^\\\\/]*')\n return p1 + unescaped\n }\n ],\n\n [\n // unescape, revert step 3 except for back slash\n // For example, if a user escape a '\\\\*',\n // after step 3, the result will be '\\\\\\\\\\\\*'\n /\\\\\\\\\\\\(?=[$.|*+(){^])/g,\n () => ESCAPE\n ],\n\n [\n // '\\\\\\\\' -> '\\\\'\n /\\\\\\\\/g,\n () => ESCAPE\n ],\n\n [\n // > The range notation, e.g. [a-zA-Z],\n // > can be used to match one of the characters in a range.\n\n // `\\` is escaped by step 3\n /(\\\\)?\\[([^\\]/]*?)(\\\\*)($|\\])/g,\n (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE\n // '\\\\[bar]' -> '\\\\\\\\[bar\\\\]'\n ? `\\\\[${range}${cleanRangeBackSlash(endEscape)}${close}`\n : close === ']'\n ? endEscape.length % 2 === 0\n // A normal case, and it is a range notation\n // '[bar]'\n // '[bar\\\\\\\\]'\n ? `[${sanitizeRange(range)}${endEscape}]`\n // Invalid range notaton\n // '[bar\\\\]' -> '[bar\\\\\\\\]'\n : '[]'\n : '[]'\n ],\n\n // ending\n [\n // 'js' will not match 'js.'\n // 'ab' will not match 'abc'\n /(?:[^*])$/,\n\n // WTF!\n // https://git-scm.com/docs/gitignore\n // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)\n // which re-fixes #24, #38\n\n // > If there is a separator at the end of the pattern then the pattern\n // > will only match directories, otherwise the pattern can match both\n // > files and directories.\n\n // 'js*' will not match 'a.js'\n // 'js/' will not match 'a.js'\n // 'js' will match 'a.js' and 'a.js/'\n match => /\\/$/.test(match)\n // foo/ will not match 'foo'\n ? `${match}$`\n // foo matches 'foo' and 'foo/'\n : `${match}(?=$|\\\\/$)`\n ],\n\n // trailing wildcard\n [\n /(\\^|\\\\\\/)?\\\\\\*$/,\n (_, p1) => {\n const prefix = p1\n // '\\^':\n // '/*' does not match EMPTY\n // '/*' does not match everything\n\n // '\\\\\\/':\n // 'abc/*' does not match 'abc/'\n ? `${p1}[^/]+`\n\n // 'a*' matches 'a'\n // 'a*' matches 'aa'\n : '[^/]*'\n\n return `${prefix}(?=$|\\\\/$)`\n }\n ],\n]\n\n// A simple cache, because an ignore rule only has only one certain meaning\nconst regexCache = Object.create(null)\n\n// @param {pattern}\nconst makeRegex = (pattern, ignoreCase) => {\n let source = regexCache[pattern]\n\n if (!source) {\n source = REPLACERS.reduce(\n (prev, current) => prev.replace(current[0], current[1].bind(pattern)),\n pattern\n )\n regexCache[pattern] = source\n }\n\n return ignoreCase\n ? new RegExp(source, 'i')\n : new RegExp(source)\n}\n\nconst isString = subject => typeof subject === 'string'\n\n// > A blank line matches no files, so it can serve as a separator for readability.\nconst checkPattern = pattern => pattern\n && isString(pattern)\n && !REGEX_TEST_BLANK_LINE.test(pattern)\n && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)\n\n // > A line starting with # serves as a comment.\n && pattern.indexOf('#') !== 0\n\nconst splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF)\n\nclass IgnoreRule {\n constructor (\n origin,\n pattern,\n negative,\n regex\n ) {\n this.origin = origin\n this.pattern = pattern\n this.negative = negative\n this.regex = regex\n }\n}\n\nconst createRule = (pattern, ignoreCase) => {\n const origin = pattern\n let negative = false\n\n // > An optional prefix \"!\" which negates the pattern;\n if (pattern.indexOf('!') === 0) {\n negative = true\n pattern = pattern.substr(1)\n }\n\n pattern = pattern\n // > Put a backslash (\"\\\") in front of the first \"!\" for patterns that\n // > begin with a literal \"!\", for example, `\"\\!important!.txt\"`.\n .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!')\n // > Put a backslash (\"\\\") in front of the first hash for patterns that\n // > begin with a hash.\n .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#')\n\n const regex = makeRegex(pattern, ignoreCase)\n\n return new IgnoreRule(\n origin,\n pattern,\n negative,\n regex\n )\n}\n\nconst throwError = (message, Ctor) => {\n throw new Ctor(message)\n}\n\nconst checkPath = (path, originalPath, doThrow) => {\n if (!isString(path)) {\n return doThrow(\n `path must be a string, but got \\`${originalPath}\\``,\n TypeError\n )\n }\n\n // We don't know if we should ignore EMPTY, so throw\n if (!path) {\n return doThrow(`path must not be empty`, TypeError)\n }\n\n // Check if it is a relative path\n if (checkPath.isNotRelative(path)) {\n const r = '`path.relative()`d'\n return doThrow(\n `path should be a ${r} string, but got \"${originalPath}\"`,\n RangeError\n )\n }\n\n return true\n}\n\nconst isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path)\n\ncheckPath.isNotRelative = isNotRelative\ncheckPath.convert = p => p\n\nclass Ignore {\n constructor ({\n ignorecase = true,\n ignoreCase = ignorecase,\n allowRelativePaths = false\n } = {}) {\n define(this, KEY_IGNORE, true)\n\n this._rules = []\n this._ignoreCase = ignoreCase\n this._allowRelativePaths = allowRelativePaths\n this._initCache()\n }\n\n _initCache () {\n this._ignoreCache = Object.create(null)\n this._testCache = Object.create(null)\n }\n\n _addPattern (pattern) {\n // #32\n if (pattern && pattern[KEY_IGNORE]) {\n this._rules = this._rules.concat(pattern._rules)\n this._added = true\n return\n }\n\n if (checkPattern(pattern)) {\n const rule = createRule(pattern, this._ignoreCase)\n this._added = true\n this._rules.push(rule)\n }\n }\n\n // @param {Array<string> | string | Ignore} pattern\n add (pattern) {\n this._added = false\n\n makeArray(\n isString(pattern)\n ? splitPattern(pattern)\n : pattern\n ).forEach(this._addPattern, this)\n\n // Some rules have just added to the ignore,\n // making the behavior changed.\n if (this._added) {\n this._initCache()\n }\n\n return this\n }\n\n // legacy\n addPattern (pattern) {\n return this.add(pattern)\n }\n\n // | ignored : unignored\n // negative | 0:0 | 0:1 | 1:0 | 1:1\n // -------- | ------- | ------- | ------- | --------\n // 0 | TEST | TEST | SKIP | X\n // 1 | TESTIF | SKIP | TEST | X\n\n // - SKIP: always skip\n // - TEST: always test\n // - TESTIF: only test if checkUnignored\n // - X: that never happen\n\n // @param {boolean} whether should check if the path is unignored,\n // setting `checkUnignored` to `false` could reduce additional\n // path matching.\n\n // @returns {TestResult} true if a file is ignored\n _testOne (path, checkUnignored) {\n let ignored = false\n let unignored = false\n\n this._rules.forEach(rule => {\n const {negative} = rule\n if (\n unignored === negative && ignored !== unignored\n || negative && !ignored && !unignored && !checkUnignored\n ) {\n return\n }\n\n const matched = rule.regex.test(path)\n\n if (matched) {\n ignored = !negative\n unignored = negative\n }\n })\n\n return {\n ignored,\n unignored\n }\n }\n\n // @returns {TestResult}\n _test (originalPath, cache, checkUnignored, slices) {\n const path = originalPath\n // Supports nullable path\n && checkPath.convert(originalPath)\n\n checkPath(\n path,\n originalPath,\n this._allowRelativePaths\n ? RETURN_FALSE\n : throwError\n )\n\n return this._t(path, cache, checkUnignored, slices)\n }\n\n _t (path, cache, checkUnignored, slices) {\n if (path in cache) {\n return cache[path]\n }\n\n if (!slices) {\n // path/to/a.js\n // ['path', 'to', 'a.js']\n slices = path.split(SLASH)\n }\n\n slices.pop()\n\n // If the path has no parent directory, just test it\n if (!slices.length) {\n return cache[path] = this._testOne(path, checkUnignored)\n }\n\n const parent = this._t(\n slices.join(SLASH) + SLASH,\n cache,\n checkUnignored,\n slices\n )\n\n // If the path contains a parent directory, check the parent first\n return cache[path] = parent.ignored\n // > It is not possible to re-include a file if a parent directory of\n // > that file is excluded.\n ? parent\n : this._testOne(path, checkUnignored)\n }\n\n ignores (path) {\n return this._test(path, this._ignoreCache, false).ignored\n }\n\n createFilter () {\n return path => !this.ignores(path)\n }\n\n filter (paths) {\n return makeArray(paths).filter(this.createFilter())\n }\n\n // @returns {TestResult}\n test (path) {\n return this._test(path, this._testCache, true)\n }\n}\n\nconst factory = options => new Ignore(options)\n\nconst isPathValid = path =>\n checkPath(path && checkPath.convert(path), path, RETURN_FALSE)\n\nfactory.isPathValid = isPathValid\n\n// Fixes typescript\nfactory.default = factory\n\nmodule.exports = factory\n\n// Windows\n// --------------------------------------------------------------\n/* istanbul ignore if */\nif (\n // Detect `process` so that it can run in browsers.\n typeof process !== 'undefined'\n && (\n process.env && process.env.IGNORE_TEST_WIN32\n || process.platform === 'win32'\n )\n) {\n /* eslint no-control-regex: \"off\" */\n const makePosix = str => /^\\\\\\\\\\?\\\\/.test(str)\n || /[\"<>|\\u0000-\\u001F]+/u.test(str)\n ? str\n : str.replace(/\\\\/g, '/')\n\n checkPath.convert = makePosix\n\n // 'C:\\\\foo' <- 'C:\\\\foo' has been converted to 'C:/'\n // 'd:\\\\foo'\n const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\\//i\n checkPath.isNotRelative = path =>\n REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path)\n || isNotRelative(path)\n}\n","const types = {\n 'application/prs.cww': ['cww'],\n 'application/prs.xsf+xml': ['xsf'],\n 'application/vnd.1000minds.decision-model+xml': ['1km'],\n 'application/vnd.3gpp.pic-bw-large': ['plb'],\n 'application/vnd.3gpp.pic-bw-small': ['psb'],\n 'application/vnd.3gpp.pic-bw-var': ['pvb'],\n 'application/vnd.3gpp2.tcap': ['tcap'],\n 'application/vnd.3m.post-it-notes': ['pwn'],\n 'application/vnd.accpac.simply.aso': ['aso'],\n 'application/vnd.accpac.simply.imp': ['imp'],\n 'application/vnd.acucobol': ['acu'],\n 'application/vnd.acucorp': ['atc', 'acutc'],\n 'application/vnd.adobe.air-application-installer-package+zip': ['air'],\n 'application/vnd.adobe.formscentral.fcdt': ['fcdt'],\n 'application/vnd.adobe.fxp': ['fxp', 'fxpl'],\n 'application/vnd.adobe.xdp+xml': ['xdp'],\n 'application/vnd.adobe.xfdf': ['*xfdf'],\n 'application/vnd.age': ['age'],\n 'application/vnd.ahead.space': ['ahead'],\n 'application/vnd.airzip.filesecure.azf': ['azf'],\n 'application/vnd.airzip.filesecure.azs': ['azs'],\n 'application/vnd.amazon.ebook': ['azw'],\n 'application/vnd.americandynamics.acc': ['acc'],\n 'application/vnd.amiga.ami': ['ami'],\n 'application/vnd.android.package-archive': ['apk'],\n 'application/vnd.anser-web-certificate-issue-initiation': ['cii'],\n 'application/vnd.anser-web-funds-transfer-initiation': ['fti'],\n 'application/vnd.antix.game-component': ['atx'],\n 'application/vnd.apple.installer+xml': ['mpkg'],\n 'application/vnd.apple.keynote': ['key'],\n 'application/vnd.apple.mpegurl': ['m3u8'],\n 'application/vnd.apple.numbers': ['numbers'],\n 'application/vnd.apple.pages': ['pages'],\n 'application/vnd.apple.pkpass': ['pkpass'],\n 'application/vnd.aristanetworks.swi': ['swi'],\n 'application/vnd.astraea-software.iota': ['iota'],\n 'application/vnd.audiograph': ['aep'],\n 'application/vnd.autodesk.fbx': ['fbx'],\n 'application/vnd.balsamiq.bmml+xml': ['bmml'],\n 'application/vnd.blueice.multipass': ['mpm'],\n 'application/vnd.bmi': ['bmi'],\n 'application/vnd.businessobjects': ['rep'],\n 'application/vnd.chemdraw+xml': ['cdxml'],\n 'application/vnd.chipnuts.karaoke-mmd': ['mmd'],\n 'application/vnd.cinderella': ['cdy'],\n 'application/vnd.citationstyles.style+xml': ['csl'],\n 'application/vnd.claymore': ['cla'],\n 'application/vnd.cloanto.rp9': ['rp9'],\n 'application/vnd.clonk.c4group': ['c4g', 'c4d', 'c4f', 'c4p', 'c4u'],\n 'application/vnd.cluetrust.cartomobile-config': ['c11amc'],\n 'application/vnd.cluetrust.cartomobile-config-pkg': ['c11amz'],\n 'application/vnd.commonspace': ['csp'],\n 'application/vnd.contact.cmsg': ['cdbcmsg'],\n 'application/vnd.cosmocaller': ['cmc'],\n 'application/vnd.crick.clicker': ['clkx'],\n 'application/vnd.crick.clicker.keyboard': ['clkk'],\n 'application/vnd.crick.clicker.palette': ['clkp'],\n 'application/vnd.crick.clicker.template': ['clkt'],\n 'application/vnd.crick.clicker.wordbank': ['clkw'],\n 'application/vnd.criticaltools.wbs+xml': ['wbs'],\n 'application/vnd.ctc-posml': ['pml'],\n 'application/vnd.cups-ppd': ['ppd'],\n 'application/vnd.curl.car': ['car'],\n 'application/vnd.curl.pcurl': ['pcurl'],\n 'application/vnd.dart': ['dart'],\n 'application/vnd.data-vision.rdz': ['rdz'],\n 'application/vnd.dbf': ['dbf'],\n 'application/vnd.dcmp+xml': ['dcmp'],\n 'application/vnd.dece.data': ['uvf', 'uvvf', 'uvd', 'uvvd'],\n 'application/vnd.dece.ttml+xml': ['uvt', 'uvvt'],\n 'application/vnd.dece.unspecified': ['uvx', 'uvvx'],\n 'application/vnd.dece.zip': ['uvz', 'uvvz'],\n 'application/vnd.denovo.fcselayout-link': ['fe_launch'],\n 'application/vnd.dna': ['dna'],\n 'application/vnd.dolby.mlp': ['mlp'],\n 'application/vnd.dpgraph': ['dpg'],\n 'application/vnd.dreamfactory': ['dfac'],\n 'application/vnd.ds-keypoint': ['kpxx'],\n 'application/vnd.dvb.ait': ['ait'],\n 'application/vnd.dvb.service': ['svc'],\n 'application/vnd.dynageo': ['geo'],\n 'application/vnd.ecowin.chart': ['mag'],\n 'application/vnd.enliven': ['nml'],\n 'application/vnd.epson.esf': ['esf'],\n 'application/vnd.epson.msf': ['msf'],\n 'application/vnd.epson.quickanime': ['qam'],\n 'application/vnd.epson.salt': ['slt'],\n 'application/vnd.epson.ssf': ['ssf'],\n 'application/vnd.eszigno3+xml': ['es3', 'et3'],\n 'application/vnd.ezpix-album': ['ez2'],\n 'application/vnd.ezpix-package': ['ez3'],\n 'application/vnd.fdf': ['*fdf'],\n 'application/vnd.fdsn.mseed': ['mseed'],\n 'application/vnd.fdsn.seed': ['seed', 'dataless'],\n 'application/vnd.flographit': ['gph'],\n 'application/vnd.fluxtime.clip': ['ftc'],\n 'application/vnd.framemaker': ['fm', 'frame', 'maker', 'book'],\n 'application/vnd.frogans.fnc': ['fnc'],\n 'application/vnd.frogans.ltf': ['ltf'],\n 'application/vnd.fsc.weblaunch': ['fsc'],\n 'application/vnd.fujitsu.oasys': ['oas'],\n 'application/vnd.fujitsu.oasys2': ['oa2'],\n 'application/vnd.fujitsu.oasys3': ['oa3'],\n 'application/vnd.fujitsu.oasysgp': ['fg5'],\n 'application/vnd.fujitsu.oasysprs': ['bh2'],\n 'application/vnd.fujixerox.ddd': ['ddd'],\n 'application/vnd.fujixerox.docuworks': ['xdw'],\n 'application/vnd.fujixerox.docuworks.binder': ['xbd'],\n 'application/vnd.fuzzysheet': ['fzs'],\n 'application/vnd.genomatix.tuxedo': ['txd'],\n 'application/vnd.geogebra.file': ['ggb'],\n 'application/vnd.geogebra.slides': ['ggs'],\n 'application/vnd.geogebra.tool': ['ggt'],\n 'application/vnd.geometry-explorer': ['gex', 'gre'],\n 'application/vnd.geonext': ['gxt'],\n 'application/vnd.geoplan': ['g2w'],\n 'application/vnd.geospace': ['g3w'],\n 'application/vnd.gmx': ['gmx'],\n 'application/vnd.google-apps.document': ['gdoc'],\n 'application/vnd.google-apps.drawing': ['gdraw'],\n 'application/vnd.google-apps.form': ['gform'],\n 'application/vnd.google-apps.jam': ['gjam'],\n 'application/vnd.google-apps.map': ['gmap'],\n 'application/vnd.google-apps.presentation': ['gslides'],\n 'application/vnd.google-apps.script': ['gscript'],\n 'application/vnd.google-apps.site': ['gsite'],\n 'application/vnd.google-apps.spreadsheet': ['gsheet'],\n 'application/vnd.google-earth.kml+xml': ['kml'],\n 'application/vnd.google-earth.kmz': ['kmz'],\n 'application/vnd.gov.sk.xmldatacontainer+xml': ['xdcf'],\n 'application/vnd.grafeq': ['gqf', 'gqs'],\n 'application/vnd.groove-account': ['gac'],\n 'application/vnd.groove-help': ['ghf'],\n 'application/vnd.groove-identity-message': ['gim'],\n 'application/vnd.groove-injector': ['grv'],\n 'application/vnd.groove-tool-message': ['gtm'],\n 'application/vnd.groove-tool-template': ['tpl'],\n 'application/vnd.groove-vcard': ['vcg'],\n 'application/vnd.hal+xml': ['hal'],\n 'application/vnd.handheld-entertainment+xml': ['zmm'],\n 'application/vnd.hbci': ['hbci'],\n 'application/vnd.hhe.lesson-player': ['les'],\n 'application/vnd.hp-hpgl': ['hpgl'],\n 'application/vnd.hp-hpid': ['hpid'],\n 'application/vnd.hp-hps': ['hps'],\n 'application/vnd.hp-jlyt': ['jlt'],\n 'application/vnd.hp-pcl': ['pcl'],\n 'application/vnd.hp-pclxl': ['pclxl'],\n 'application/vnd.hydrostatix.sof-data': ['sfd-hdstx'],\n 'application/vnd.ibm.minipay': ['mpy'],\n 'application/vnd.ibm.modcap': ['afp', 'listafp', 'list3820'],\n 'application/vnd.ibm.rights-management': ['irm'],\n 'application/vnd.ibm.secure-container': ['sc'],\n 'application/vnd.iccprofile': ['icc', 'icm'],\n 'application/vnd.igloader': ['igl'],\n 'application/vnd.immervision-ivp': ['ivp'],\n 'application/vnd.immervision-ivu': ['ivu'],\n 'application/vnd.insors.igm': ['igm'],\n 'application/vnd.intercon.formnet': ['xpw', 'xpx'],\n 'application/vnd.intergeo': ['i2g'],\n 'application/vnd.intu.qbo': ['qbo'],\n 'application/vnd.intu.qfx': ['qfx'],\n 'application/vnd.ipunplugged.rcprofile': ['rcprofile'],\n 'application/vnd.irepository.package+xml': ['irp'],\n 'application/vnd.is-xpr': ['xpr'],\n 'application/vnd.isac.fcs': ['fcs'],\n 'application/vnd.jam': ['jam'],\n 'application/vnd.jcp.javame.midlet-rms': ['rms'],\n 'application/vnd.jisp': ['jisp'],\n 'application/vnd.joost.joda-archive': ['joda'],\n 'application/vnd.kahootz': ['ktz', 'ktr'],\n 'application/vnd.kde.karbon': ['karbon'],\n 'application/vnd.kde.kchart': ['chrt'],\n 'application/vnd.kde.kformula': ['kfo'],\n 'application/vnd.kde.kivio': ['flw'],\n 'application/vnd.kde.kontour': ['kon'],\n 'application/vnd.kde.kpresenter': ['kpr', 'kpt'],\n 'application/vnd.kde.kspread': ['ksp'],\n 'application/vnd.kde.kword': ['kwd', 'kwt'],\n 'application/vnd.kenameaapp': ['htke'],\n 'application/vnd.kidspiration': ['kia'],\n 'application/vnd.kinar': ['kne', 'knp'],\n 'application/vnd.koan': ['skp', 'skd', 'skt', 'skm'],\n 'application/vnd.kodak-descriptor': ['sse'],\n 'application/vnd.las.las+xml': ['lasxml'],\n 'application/vnd.llamagraphics.life-balance.desktop': ['lbd'],\n 'application/vnd.llamagraphics.life-balance.exchange+xml': ['lbe'],\n 'application/vnd.lotus-1-2-3': ['123'],\n 'application/vnd.lotus-approach': ['apr'],\n 'application/vnd.lotus-freelance': ['pre'],\n 'application/vnd.lotus-notes': ['nsf'],\n 'application/vnd.lotus-organizer': ['org'],\n 'application/vnd.lotus-screencam': ['scm'],\n 'application/vnd.lotus-wordpro': ['lwp'],\n 'application/vnd.macports.portpkg': ['portpkg'],\n 'application/vnd.mapbox-vector-tile': ['mvt'],\n 'application/vnd.mcd': ['mcd'],\n 'application/vnd.medcalcdata': ['mc1'],\n 'application/vnd.mediastation.cdkey': ['cdkey'],\n 'application/vnd.mfer': ['mwf'],\n 'application/vnd.mfmp': ['mfm'],\n 'application/vnd.micrografx.flo': ['flo'],\n 'application/vnd.micrografx.igx': ['igx'],\n 'application/vnd.mif': ['mif'],\n 'application/vnd.mobius.daf': ['daf'],\n 'application/vnd.mobius.dis': ['dis'],\n 'application/vnd.mobius.mbk': ['mbk'],\n 'application/vnd.mobius.mqy': ['mqy'],\n 'application/vnd.mobius.msl': ['msl'],\n 'application/vnd.mobius.plc': ['plc'],\n 'application/vnd.mobius.txf': ['txf'],\n 'application/vnd.mophun.application': ['mpn'],\n 'application/vnd.mophun.certificate': ['mpc'],\n 'application/vnd.mozilla.xul+xml': ['xul'],\n 'application/vnd.ms-artgalry': ['cil'],\n 'application/vnd.ms-cab-compressed': ['cab'],\n 'application/vnd.ms-excel': ['xls', 'xlm', 'xla', 'xlc', 'xlt', 'xlw'],\n 'application/vnd.ms-excel.addin.macroenabled.12': ['xlam'],\n 'application/vnd.ms-excel.sheet.binary.macroenabled.12': ['xlsb'],\n 'application/vnd.ms-excel.sheet.macroenabled.12': ['xlsm'],\n 'application/vnd.ms-excel.template.macroenabled.12': ['xltm'],\n 'application/vnd.ms-fontobject': ['eot'],\n 'application/vnd.ms-htmlhelp': ['chm'],\n 'application/vnd.ms-ims': ['ims'],\n 'application/vnd.ms-lrm': ['lrm'],\n 'application/vnd.ms-officetheme': ['thmx'],\n 'application/vnd.ms-outlook': ['msg'],\n 'application/vnd.ms-pki.seccat': ['cat'],\n 'application/vnd.ms-pki.stl': ['*stl'],\n 'application/vnd.ms-powerpoint': ['ppt', 'pps', 'pot'],\n 'application/vnd.ms-powerpoint.addin.macroenabled.12': ['ppam'],\n 'application/vnd.ms-powerpoint.presentation.macroenabled.12': ['pptm'],\n 'application/vnd.ms-powerpoint.slide.macroenabled.12': ['sldm'],\n 'application/vnd.ms-powerpoint.slideshow.macroenabled.12': ['ppsm'],\n 'application/vnd.ms-powerpoint.template.macroenabled.12': ['potm'],\n 'application/vnd.ms-project': ['*mpp', 'mpt'],\n 'application/vnd.ms-visio.viewer': ['vdx'],\n 'application/vnd.ms-word.document.macroenabled.12': ['docm'],\n 'application/vnd.ms-word.template.macroenabled.12': ['dotm'],\n 'application/vnd.ms-works': ['wps', 'wks', 'wcm', 'wdb'],\n 'application/vnd.ms-wpl': ['wpl'],\n 'application/vnd.ms-xpsdocument': ['xps'],\n 'application/vnd.mseq': ['mseq'],\n 'application/vnd.musician': ['mus'],\n 'application/vnd.muvee.style': ['msty'],\n 'application/vnd.mynfc': ['taglet'],\n 'application/vnd.nato.bindingdataobject+xml': ['bdo'],\n 'application/vnd.neurolanguage.nlu': ['nlu'],\n 'application/vnd.nitf': ['ntf', 'nitf'],\n 'application/vnd.noblenet-directory': ['nnd'],\n 'application/vnd.noblenet-sealer': ['nns'],\n 'application/vnd.noblenet-web': ['nnw'],\n 'application/vnd.nokia.n-gage.ac+xml': ['*ac'],\n 'application/vnd.nokia.n-gage.data': ['ngdat'],\n 'application/vnd.nokia.n-gage.symbian.install': ['n-gage'],\n 'application/vnd.nokia.radio-preset': ['rpst'],\n 'application/vnd.nokia.radio-presets': ['rpss'],\n 'application/vnd.novadigm.edm': ['edm'],\n 'application/vnd.novadigm.edx': ['edx'],\n 'application/vnd.novadigm.ext': ['ext'],\n 'application/vnd.oasis.opendocument.chart': ['odc'],\n 'application/vnd.oasis.opendocument.chart-template': ['otc'],\n 'application/vnd.oasis.opendocument.database': ['odb'],\n 'application/vnd.oasis.opendocument.formula': ['odf'],\n 'application/vnd.oasis.opendocument.formula-template': ['odft'],\n 'application/vnd.oasis.opendocument.graphics': ['odg'],\n 'application/vnd.oasis.opendocument.graphics-template': ['otg'],\n 'application/vnd.oasis.opendocument.image': ['odi'],\n 'application/vnd.oasis.opendocument.image-template': ['oti'],\n 'application/vnd.oasis.opendocument.presentation': ['odp'],\n 'application/vnd.oasis.opendocument.presentation-template': ['otp'],\n 'application/vnd.oasis.opendocument.spreadsheet': ['ods'],\n 'application/vnd.oasis.opendocument.spreadsheet-template': ['ots'],\n 'application/vnd.oasis.opendocument.text': ['odt'],\n 'application/vnd.oasis.opendocument.text-master': ['odm'],\n 'application/vnd.oasis.opendocument.text-template': ['ott'],\n 'application/vnd.oasis.opendocument.text-web': ['oth'],\n 'application/vnd.olpc-sugar': ['xo'],\n 'application/vnd.oma.dd2+xml': ['dd2'],\n 'application/vnd.openblox.game+xml': ['obgx'],\n 'application/vnd.openofficeorg.extension': ['oxt'],\n 'application/vnd.openstreetmap.data+xml': ['osm'],\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation': [\n 'pptx',\n ],\n 'application/vnd.openxmlformats-officedocument.presentationml.slide': [\n 'sldx',\n ],\n 'application/vnd.openxmlformats-officedocument.presentationml.slideshow': [\n 'ppsx',\n ],\n 'application/vnd.openxmlformats-officedocument.presentationml.template': [\n 'potx',\n ],\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': ['xlsx'],\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.template': [\n 'xltx',\n ],\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': [\n 'docx',\n ],\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.template': [\n 'dotx',\n ],\n 'application/vnd.osgeo.mapguide.package': ['mgp'],\n 'application/vnd.osgi.dp': ['dp'],\n 'application/vnd.osgi.subsystem': ['esa'],\n 'application/vnd.palm': ['pdb', 'pqa', 'oprc'],\n 'application/vnd.pawaafile': ['paw'],\n 'application/vnd.pg.format': ['str'],\n 'application/vnd.pg.osasli': ['ei6'],\n 'application/vnd.picsel': ['efif'],\n 'application/vnd.pmi.widget': ['wg'],\n 'application/vnd.pocketlearn': ['plf'],\n 'application/vnd.powerbuilder6': ['pbd'],\n 'application/vnd.previewsystems.box': ['box'],\n 'application/vnd.procrate.brushset': ['brushset'],\n 'application/vnd.procreate.brush': ['brush'],\n 'application/vnd.procreate.dream': ['drm'],\n 'application/vnd.proteus.magazine': ['mgz'],\n 'application/vnd.publishare-delta-tree': ['qps'],\n 'application/vnd.pvi.ptid1': ['ptid'],\n 'application/vnd.pwg-xhtml-print+xml': ['xhtm'],\n 'application/vnd.quark.quarkxpress': [\n 'qxd',\n 'qxt',\n 'qwd',\n 'qwt',\n 'qxl',\n 'qxb',\n ],\n 'application/vnd.rar': ['rar'],\n 'application/vnd.realvnc.bed': ['bed'],\n 'application/vnd.recordare.musicxml': ['mxl'],\n 'application/vnd.recordare.musicxml+xml': ['musicxml'],\n 'application/vnd.rig.cryptonote': ['cryptonote'],\n 'application/vnd.rim.cod': ['cod'],\n 'application/vnd.rn-realmedia': ['rm'],\n 'application/vnd.rn-realmedia-vbr': ['rmvb'],\n 'application/vnd.route66.link66+xml': ['link66'],\n 'application/vnd.sailingtracker.track': ['st'],\n 'application/vnd.seemail': ['see'],\n 'application/vnd.sema': ['sema'],\n 'application/vnd.semd': ['semd'],\n 'application/vnd.semf': ['semf'],\n 'application/vnd.shana.informed.formdata': ['ifm'],\n 'application/vnd.shana.informed.formtemplate': ['itp'],\n 'application/vnd.shana.informed.interchange': ['iif'],\n 'application/vnd.shana.informed.package': ['ipk'],\n 'application/vnd.simtech-mindmapper': ['twd', 'twds'],\n 'application/vnd.smaf': ['mmf'],\n 'application/vnd.smart.teacher': ['teacher'],\n 'application/vnd.software602.filler.form+xml': ['fo'],\n 'application/vnd.solent.sdkm+xml': ['sdkm', 'sdkd'],\n 'application/vnd.spotfire.dxp': ['dxp'],\n 'application/vnd.spotfire.sfs': ['sfs'],\n 'application/vnd.stardivision.calc': ['sdc'],\n 'application/vnd.stardivision.draw': ['sda'],\n 'application/vnd.stardivision.impress': ['sdd'],\n 'application/vnd.stardivision.math': ['smf'],\n 'application/vnd.stardivision.writer': ['sdw', 'vor'],\n 'application/vnd.stardivision.writer-global': ['sgl'],\n 'application/vnd.stepmania.package': ['smzip'],\n 'application/vnd.stepmania.stepchart': ['sm'],\n 'application/vnd.sun.wadl+xml': ['wadl'],\n 'application/vnd.sun.xml.calc': ['sxc'],\n 'application/vnd.sun.xml.calc.template': ['stc'],\n 'application/vnd.sun.xml.draw': ['sxd'],\n 'application/vnd.sun.xml.draw.template': ['std'],\n 'application/vnd.sun.xml.impress': ['sxi'],\n 'application/vnd.sun.xml.impress.template': ['sti'],\n 'application/vnd.sun.xml.math': ['sxm'],\n 'application/vnd.sun.xml.writer': ['sxw'],\n 'application/vnd.sun.xml.writer.global': ['sxg'],\n 'application/vnd.sun.xml.writer.template': ['stw'],\n 'application/vnd.sus-calendar': ['sus', 'susp'],\n 'application/vnd.svd': ['svd'],\n 'application/vnd.symbian.install': ['sis', 'sisx'],\n 'application/vnd.syncml+xml': ['xsm'],\n 'application/vnd.syncml.dm+wbxml': ['bdm'],\n 'application/vnd.syncml.dm+xml': ['xdm'],\n 'application/vnd.syncml.dmddf+xml': ['ddf'],\n 'application/vnd.tao.intent-module-archive': ['tao'],\n 'application/vnd.tcpdump.pcap': ['pcap', 'cap', 'dmp'],\n 'application/vnd.tmobile-livetv': ['tmo'],\n 'application/vnd.trid.tpt': ['tpt'],\n 'application/vnd.triscape.mxs': ['mxs'],\n 'application/vnd.trueapp': ['tra'],\n 'application/vnd.ufdl': ['ufd', 'ufdl'],\n 'application/vnd.uiq.theme': ['utz'],\n 'application/vnd.umajin': ['umj'],\n 'application/vnd.unity': ['unityweb'],\n 'application/vnd.uoml+xml': ['uoml', 'uo'],\n 'application/vnd.vcx': ['vcx'],\n 'application/vnd.visio': ['vsd', 'vst', 'vss', 'vsw', 'vsdx', 'vtx'],\n 'application/vnd.visionary': ['vis'],\n 'application/vnd.vsf': ['vsf'],\n 'application/vnd.wap.wbxml': ['wbxml'],\n 'application/vnd.wap.wmlc': ['wmlc'],\n 'application/vnd.wap.wmlscriptc': ['wmlsc'],\n 'application/vnd.webturbo': ['wtb'],\n 'application/vnd.wolfram.player': ['nbp'],\n 'application/vnd.wordperfect': ['wpd'],\n 'application/vnd.wqd': ['wqd'],\n 'application/vnd.wt.stf': ['stf'],\n 'application/vnd.xara': ['xar'],\n 'application/vnd.xfdl': ['xfdl'],\n 'application/vnd.yamaha.hv-dic': ['hvd'],\n 'application/vnd.yamaha.hv-script': ['hvs'],\n 'application/vnd.yamaha.hv-voice': ['hvp'],\n 'application/vnd.yamaha.openscoreformat': ['osf'],\n 'application/vnd.yamaha.openscoreformat.osfpvg+xml': ['osfpvg'],\n 'application/vnd.yamaha.smaf-audio': ['saf'],\n 'application/vnd.yamaha.smaf-phrase': ['spf'],\n 'application/vnd.yellowriver-custom-menu': ['cmp'],\n 'application/vnd.zul': ['zir', 'zirz'],\n 'application/vnd.zzazz.deck+xml': ['zaz'],\n 'application/x-7z-compressed': ['7z'],\n 'application/x-abiword': ['abw'],\n 'application/x-ace-compressed': ['ace'],\n 'application/x-apple-diskimage': ['*dmg'],\n 'application/x-arj': ['arj'],\n 'application/x-authorware-bin': ['aab', 'x32', 'u32', 'vox'],\n 'application/x-authorware-map': ['aam'],\n 'application/x-authorware-seg': ['aas'],\n 'application/x-bcpio': ['bcpio'],\n 'application/x-bdoc': ['*bdoc'],\n 'application/x-bittorrent': ['torrent'],\n 'application/x-blender': ['blend'],\n 'application/x-blorb': ['blb', 'blorb'],\n 'application/x-bzip': ['bz'],\n 'application/x-bzip2': ['bz2', 'boz'],\n 'application/x-cbr': ['cbr', 'cba', 'cbt', 'cbz', 'cb7'],\n 'application/x-cdlink': ['vcd'],\n 'application/x-cfs-compressed': ['cfs'],\n 'application/x-chat': ['chat'],\n 'application/x-chess-pgn': ['pgn'],\n 'application/x-chrome-extension': ['crx'],\n 'application/x-cocoa': ['cco'],\n 'application/x-compressed': ['*rar'],\n 'application/x-conference': ['nsc'],\n 'application/x-cpio': ['cpio'],\n 'application/x-csh': ['csh'],\n 'application/x-debian-package': ['*deb', 'udeb'],\n 'application/x-dgc-compressed': ['dgc'],\n 'application/x-director': [\n 'dir',\n 'dcr',\n 'dxr',\n 'cst',\n 'cct',\n 'cxt',\n 'w3d',\n 'fgd',\n 'swa',\n ],\n 'application/x-doom': ['wad'],\n 'application/x-dtbncx+xml': ['ncx'],\n 'application/x-dtbook+xml': ['dtb'],\n 'application/x-dtbresource+xml': ['res'],\n 'application/x-dvi': ['dvi'],\n 'application/x-envoy': ['evy'],\n 'application/x-eva': ['eva'],\n 'application/x-font-bdf': ['bdf'],\n 'application/x-font-ghostscript': ['gsf'],\n 'application/x-font-linux-psf': ['psf'],\n 'application/x-font-pcf': ['pcf'],\n 'application/x-font-snf': ['snf'],\n 'application/x-font-type1': ['pfa', 'pfb', 'pfm', 'afm'],\n 'application/x-freearc': ['arc'],\n 'application/x-futuresplash': ['spl'],\n 'application/x-gca-compressed': ['gca'],\n 'application/x-glulx': ['ulx'],\n 'application/x-gnumeric': ['gnumeric'],\n 'application/x-gramps-xml': ['gramps'],\n 'application/x-gtar': ['gtar'],\n 'application/x-hdf': ['hdf'],\n 'application/x-httpd-php': ['php'],\n 'application/x-install-instructions': ['install'],\n 'application/x-ipynb+json': ['ipynb'],\n 'application/x-iso9660-image': ['*iso'],\n 'application/x-iwork-keynote-sffkey': ['*key'],\n 'application/x-iwork-numbers-sffnumbers': ['*numbers'],\n 'application/x-iwork-pages-sffpages': ['*pages'],\n 'application/x-java-archive-diff': ['jardiff'],\n 'application/x-java-jnlp-file': ['jnlp'],\n 'application/x-keepass2': ['kdbx'],\n 'application/x-latex': ['latex'],\n 'application/x-lua-bytecode': ['luac'],\n 'application/x-lzh-compressed': ['lzh', 'lha'],\n 'application/x-makeself': ['run'],\n 'application/x-mie': ['mie'],\n 'application/x-mobipocket-ebook': ['*prc', 'mobi'],\n 'application/x-ms-application': ['application'],\n 'application/x-ms-shortcut': ['lnk'],\n 'application/x-ms-wmd': ['wmd'],\n 'application/x-ms-wmz': ['wmz'],\n 'application/x-ms-xbap': ['xbap'],\n 'application/x-msaccess': ['mdb'],\n 'application/x-msbinder': ['obd'],\n 'application/x-mscardfile': ['crd'],\n 'application/x-msclip': ['clp'],\n 'application/x-msdos-program': ['*exe'],\n 'application/x-msdownload': ['*exe', '*dll', 'com', 'bat', '*msi'],\n 'application/x-msmediaview': ['mvb', 'm13', 'm14'],\n 'application/x-msmetafile': ['*wmf', '*wmz', '*emf', 'emz'],\n 'application/x-msmoney': ['mny'],\n 'application/x-mspublisher': ['pub'],\n 'application/x-msschedule': ['scd'],\n 'application/x-msterminal': ['trm'],\n 'application/x-mswrite': ['wri'],\n 'application/x-netcdf': ['nc', 'cdf'],\n 'application/x-ns-proxy-autoconfig': ['pac'],\n 'application/x-nzb': ['nzb'],\n 'application/x-perl': ['pl', 'pm'],\n 'application/x-pilot': ['*prc', '*pdb'],\n 'application/x-pkcs12': ['p12', 'pfx'],\n 'application/x-pkcs7-certificates': ['p7b', 'spc'],\n 'application/x-pkcs7-certreqresp': ['p7r'],\n 'application/x-rar-compressed': ['*rar'],\n 'application/x-redhat-package-manager': ['rpm'],\n 'application/x-research-info-systems': ['ris'],\n 'application/x-sea': ['sea'],\n 'application/x-sh': ['sh'],\n 'application/x-shar': ['shar'],\n 'application/x-shockwave-flash': ['swf'],\n 'application/x-silverlight-app': ['xap'],\n 'application/x-sql': ['*sql'],\n 'application/x-stuffit': ['sit'],\n 'application/x-stuffitx': ['sitx'],\n 'application/x-subrip': ['srt'],\n 'application/x-sv4cpio': ['sv4cpio'],\n 'application/x-sv4crc': ['sv4crc'],\n 'application/x-t3vm-image': ['t3'],\n 'application/x-tads': ['gam'],\n 'application/x-tar': ['tar'],\n 'application/x-tcl': ['tcl', 'tk'],\n 'application/x-tex': ['tex'],\n 'application/x-tex-tfm': ['tfm'],\n 'application/x-texinfo': ['texinfo', 'texi'],\n 'application/x-tgif': ['*obj'],\n 'application/x-ustar': ['ustar'],\n 'application/x-virtualbox-hdd': ['hdd'],\n 'application/x-virtualbox-ova': ['ova'],\n 'application/x-virtualbox-ovf': ['ovf'],\n 'application/x-virtualbox-vbox': ['vbox'],\n 'application/x-virtualbox-vbox-extpack': ['vbox-extpack'],\n 'application/x-virtualbox-vdi': ['vdi'],\n 'application/x-virtualbox-vhd': ['vhd'],\n 'application/x-virtualbox-vmdk': ['vmdk'],\n 'application/x-wais-source': ['src'],\n 'application/x-web-app-manifest+json': ['webapp'],\n 'application/x-x509-ca-cert': ['der', 'crt', 'pem'],\n 'application/x-xfig': ['fig'],\n 'application/x-xliff+xml': ['*xlf'],\n 'application/x-xpinstall': ['xpi'],\n 'application/x-xz': ['xz'],\n 'application/x-zip-compressed': ['*zip'],\n 'application/x-zmachine': ['z1', 'z2', 'z3', 'z4', 'z5', 'z6', 'z7', 'z8'],\n 'audio/vnd.dece.audio': ['uva', 'uvva'],\n 'audio/vnd.digital-winds': ['eol'],\n 'audio/vnd.dra': ['dra'],\n 'audio/vnd.dts': ['dts'],\n 'audio/vnd.dts.hd': ['dtshd'],\n 'audio/vnd.lucent.voice': ['lvp'],\n 'audio/vnd.ms-playready.media.pya': ['pya'],\n 'audio/vnd.nuera.ecelp4800': ['ecelp4800'],\n 'audio/vnd.nuera.ecelp7470': ['ecelp7470'],\n 'audio/vnd.nuera.ecelp9600': ['ecelp9600'],\n 'audio/vnd.rip': ['rip'],\n 'audio/x-aac': ['*aac'],\n 'audio/x-aiff': ['aif', 'aiff', 'aifc'],\n 'audio/x-caf': ['caf'],\n 'audio/x-flac': ['flac'],\n 'audio/x-m4a': ['*m4a'],\n 'audio/x-matroska': ['mka'],\n 'audio/x-mpegurl': ['m3u'],\n 'audio/x-ms-wax': ['wax'],\n 'audio/x-ms-wma': ['wma'],\n 'audio/x-pn-realaudio': ['ram', 'ra'],\n 'audio/x-pn-realaudio-plugin': ['rmp'],\n 'audio/x-realaudio': ['*ra'],\n 'audio/x-wav': ['*wav'],\n 'chemical/x-cdx': ['cdx'],\n 'chemical/x-cif': ['cif'],\n 'chemical/x-cmdf': ['cmdf'],\n 'chemical/x-cml': ['cml'],\n 'chemical/x-csml': ['csml'],\n 'chemical/x-xyz': ['xyz'],\n 'image/prs.btif': ['btif', 'btf'],\n 'image/prs.pti': ['pti'],\n 'image/vnd.adobe.photoshop': ['psd'],\n 'image/vnd.airzip.accelerator.azv': ['azv'],\n 'image/vnd.dece.graphic': ['uvi', 'uvvi', 'uvg', 'uvvg'],\n 'image/vnd.djvu': ['djvu', 'djv'],\n 'image/vnd.dvb.subtitle': ['*sub'],\n 'image/vnd.dwg': ['dwg'],\n 'image/vnd.dxf': ['dxf'],\n 'image/vnd.fastbidsheet': ['fbs'],\n 'image/vnd.fpx': ['fpx'],\n 'image/vnd.fst': ['fst'],\n 'image/vnd.fujixerox.edmics-mmr': ['mmr'],\n 'image/vnd.fujixerox.edmics-rlc': ['rlc'],\n 'image/vnd.microsoft.icon': ['ico'],\n 'image/vnd.ms-dds': ['dds'],\n 'image/vnd.ms-modi': ['mdi'],\n 'image/vnd.ms-photo': ['wdp'],\n 'image/vnd.net-fpx': ['npx'],\n 'image/vnd.pco.b16': ['b16'],\n 'image/vnd.tencent.tap': ['tap'],\n 'image/vnd.valve.source.texture': ['vtf'],\n 'image/vnd.wap.wbmp': ['wbmp'],\n 'image/vnd.xiff': ['xif'],\n 'image/vnd.zbrush.pcx': ['pcx'],\n 'image/x-3ds': ['3ds'],\n 'image/x-adobe-dng': ['dng'],\n 'image/x-cmu-raster': ['ras'],\n 'image/x-cmx': ['cmx'],\n 'image/x-freehand': ['fh', 'fhc', 'fh4', 'fh5', 'fh7'],\n 'image/x-icon': ['*ico'],\n 'image/x-jng': ['jng'],\n 'image/x-mrsid-image': ['sid'],\n 'image/x-ms-bmp': ['*bmp'],\n 'image/x-pcx': ['*pcx'],\n 'image/x-pict': ['pic', 'pct'],\n 'image/x-portable-anymap': ['pnm'],\n 'image/x-portable-bitmap': ['pbm'],\n 'image/x-portable-graymap': ['pgm'],\n 'image/x-portable-pixmap': ['ppm'],\n 'image/x-rgb': ['rgb'],\n 'image/x-tga': ['tga'],\n 'image/x-xbitmap': ['xbm'],\n 'image/x-xpixmap': ['xpm'],\n 'image/x-xwindowdump': ['xwd'],\n 'message/vnd.wfa.wsc': ['wsc'],\n 'model/vnd.bary': ['bary'],\n 'model/vnd.cld': ['cld'],\n 'model/vnd.collada+xml': ['dae'],\n 'model/vnd.dwf': ['dwf'],\n 'model/vnd.gdl': ['gdl'],\n 'model/vnd.gtw': ['gtw'],\n 'model/vnd.mts': ['*mts'],\n 'model/vnd.opengex': ['ogex'],\n 'model/vnd.parasolid.transmit.binary': ['x_b'],\n 'model/vnd.parasolid.transmit.text': ['x_t'],\n 'model/vnd.pytha.pyox': ['pyo', 'pyox'],\n 'model/vnd.sap.vds': ['vds'],\n 'model/vnd.usda': ['usda'],\n 'model/vnd.usdz+zip': ['usdz'],\n 'model/vnd.valve.source.compiled-map': ['bsp'],\n 'model/vnd.vtu': ['vtu'],\n 'text/prs.lines.tag': ['dsc'],\n 'text/vnd.curl': ['curl'],\n 'text/vnd.curl.dcurl': ['dcurl'],\n 'text/vnd.curl.mcurl': ['mcurl'],\n 'text/vnd.curl.scurl': ['scurl'],\n 'text/vnd.dvb.subtitle': ['sub'],\n 'text/vnd.familysearch.gedcom': ['ged'],\n 'text/vnd.fly': ['fly'],\n 'text/vnd.fmi.flexstor': ['flx'],\n 'text/vnd.graphviz': ['gv'],\n 'text/vnd.in3d.3dml': ['3dml'],\n 'text/vnd.in3d.spot': ['spot'],\n 'text/vnd.sun.j2me.app-descriptor': ['jad'],\n 'text/vnd.wap.wml': ['wml'],\n 'text/vnd.wap.wmlscript': ['wmls'],\n 'text/x-asm': ['s', 'asm'],\n 'text/x-c': ['c', 'cc', 'cxx', 'cpp', 'h', 'hh', 'dic'],\n 'text/x-component': ['htc'],\n 'text/x-fortran': ['f', 'for', 'f77', 'f90'],\n 'text/x-handlebars-template': ['hbs'],\n 'text/x-java-source': ['java'],\n 'text/x-lua': ['lua'],\n 'text/x-markdown': ['mkd'],\n 'text/x-nfo': ['nfo'],\n 'text/x-opml': ['opml'],\n 'text/x-org': ['*org'],\n 'text/x-pascal': ['p', 'pas'],\n 'text/x-processing': ['pde'],\n 'text/x-sass': ['sass'],\n 'text/x-scss': ['scss'],\n 'text/x-setext': ['etx'],\n 'text/x-sfv': ['sfv'],\n 'text/x-suse-ymp': ['ymp'],\n 'text/x-uuencode': ['uu'],\n 'text/x-vcalendar': ['vcs'],\n 'text/x-vcard': ['vcf'],\n 'video/vnd.dece.hd': ['uvh', 'uvvh'],\n 'video/vnd.dece.mobile': ['uvm', 'uvvm'],\n 'video/vnd.dece.pd': ['uvp', 'uvvp'],\n 'video/vnd.dece.sd': ['uvs', 'uvvs'],\n 'video/vnd.dece.video': ['uvv', 'uvvv'],\n 'video/vnd.dvb.file': ['dvb'],\n 'video/vnd.fvt': ['fvt'],\n 'video/vnd.mpegurl': ['mxu', 'm4u'],\n 'video/vnd.ms-playready.media.pyv': ['pyv'],\n 'video/vnd.uvvu.mp4': ['uvu', 'uvvu'],\n 'video/vnd.vivo': ['viv'],\n 'video/x-f4v': ['f4v'],\n 'video/x-fli': ['fli'],\n 'video/x-flv': ['flv'],\n 'video/x-m4v': ['m4v'],\n 'video/x-matroska': ['mkv', 'mk3d', 'mks'],\n 'video/x-mng': ['mng'],\n 'video/x-ms-asf': ['asf', 'asx'],\n 'video/x-ms-vob': ['vob'],\n 'video/x-ms-wm': ['wm'],\n 'video/x-ms-wmv': ['wmv'],\n 'video/x-ms-wmx': ['wmx'],\n 'video/x-ms-wvx': ['wvx'],\n 'video/x-msvideo': ['avi'],\n 'video/x-sgi-movie': ['movie'],\n 'video/x-smv': ['smv'],\n 'x-conference/x-cooltalk': ['ice'],\n};\nObject.freeze(types);\nexport default types;\n","const types = {\n 'application/andrew-inset': ['ez'],\n 'application/appinstaller': ['appinstaller'],\n 'application/applixware': ['aw'],\n 'application/appx': ['appx'],\n 'application/appxbundle': ['appxbundle'],\n 'application/atom+xml': ['atom'],\n 'application/atomcat+xml': ['atomcat'],\n 'application/atomdeleted+xml': ['atomdeleted'],\n 'application/atomsvc+xml': ['atomsvc'],\n 'application/atsc-dwd+xml': ['dwd'],\n 'application/atsc-held+xml': ['held'],\n 'application/atsc-rsat+xml': ['rsat'],\n 'application/automationml-aml+xml': ['aml'],\n 'application/automationml-amlx+zip': ['amlx'],\n 'application/bdoc': ['bdoc'],\n 'application/calendar+xml': ['xcs'],\n 'application/ccxml+xml': ['ccxml'],\n 'application/cdfx+xml': ['cdfx'],\n 'application/cdmi-capability': ['cdmia'],\n 'application/cdmi-container': ['cdmic'],\n 'application/cdmi-domain': ['cdmid'],\n 'application/cdmi-object': ['cdmio'],\n 'application/cdmi-queue': ['cdmiq'],\n 'application/cpl+xml': ['cpl'],\n 'application/cu-seeme': ['cu'],\n 'application/cwl': ['cwl'],\n 'application/dash+xml': ['mpd'],\n 'application/dash-patch+xml': ['mpp'],\n 'application/davmount+xml': ['davmount'],\n 'application/dicom': ['dcm'],\n 'application/docbook+xml': ['dbk'],\n 'application/dssc+der': ['dssc'],\n 'application/dssc+xml': ['xdssc'],\n 'application/ecmascript': ['ecma'],\n 'application/emma+xml': ['emma'],\n 'application/emotionml+xml': ['emotionml'],\n 'application/epub+zip': ['epub'],\n 'application/exi': ['exi'],\n 'application/express': ['exp'],\n 'application/fdf': ['fdf'],\n 'application/fdt+xml': ['fdt'],\n 'application/font-tdpfr': ['pfr'],\n 'application/geo+json': ['geojson'],\n 'application/gml+xml': ['gml'],\n 'application/gpx+xml': ['gpx'],\n 'application/gxf': ['gxf'],\n 'application/gzip': ['gz'],\n 'application/hjson': ['hjson'],\n 'application/hyperstudio': ['stk'],\n 'application/inkml+xml': ['ink', 'inkml'],\n 'application/ipfix': ['ipfix'],\n 'application/its+xml': ['its'],\n 'application/java-archive': ['jar', 'war', 'ear'],\n 'application/java-serialized-object': ['ser'],\n 'application/java-vm': ['class'],\n 'application/javascript': ['*js'],\n 'application/json': ['json', 'map'],\n 'application/json5': ['json5'],\n 'application/jsonml+json': ['jsonml'],\n 'application/ld+json': ['jsonld'],\n 'application/lgr+xml': ['lgr'],\n 'application/lost+xml': ['lostxml'],\n 'application/mac-binhex40': ['hqx'],\n 'application/mac-compactpro': ['cpt'],\n 'application/mads+xml': ['mads'],\n 'application/manifest+json': ['webmanifest'],\n 'application/marc': ['mrc'],\n 'application/marcxml+xml': ['mrcx'],\n 'application/mathematica': ['ma', 'nb', 'mb'],\n 'application/mathml+xml': ['mathml'],\n 'application/mbox': ['mbox'],\n 'application/media-policy-dataset+xml': ['mpf'],\n 'application/mediaservercontrol+xml': ['mscml'],\n 'application/metalink+xml': ['metalink'],\n 'application/metalink4+xml': ['meta4'],\n 'application/mets+xml': ['mets'],\n 'application/mmt-aei+xml': ['maei'],\n 'application/mmt-usd+xml': ['musd'],\n 'application/mods+xml': ['mods'],\n 'application/mp21': ['m21', 'mp21'],\n 'application/mp4': ['*mp4', '*mpg4', 'mp4s', 'm4p'],\n 'application/msix': ['msix'],\n 'application/msixbundle': ['msixbundle'],\n 'application/msword': ['doc', 'dot'],\n 'application/mxf': ['mxf'],\n 'application/n-quads': ['nq'],\n 'application/n-triples': ['nt'],\n 'application/node': ['cjs'],\n 'application/octet-stream': [\n 'bin',\n 'dms',\n 'lrf',\n 'mar',\n 'so',\n 'dist',\n 'distz',\n 'pkg',\n 'bpk',\n 'dump',\n 'elc',\n 'deploy',\n 'exe',\n 'dll',\n 'deb',\n 'dmg',\n 'iso',\n 'img',\n 'msi',\n 'msp',\n 'msm',\n 'buffer',\n ],\n 'application/oda': ['oda'],\n 'application/oebps-package+xml': ['opf'],\n 'application/ogg': ['ogx'],\n 'application/omdoc+xml': ['omdoc'],\n 'application/onenote': [\n 'onetoc',\n 'onetoc2',\n 'onetmp',\n 'onepkg',\n 'one',\n 'onea',\n ],\n 'application/oxps': ['oxps'],\n 'application/p2p-overlay+xml': ['relo'],\n 'application/patch-ops-error+xml': ['xer'],\n 'application/pdf': ['pdf'],\n 'application/pgp-encrypted': ['pgp'],\n 'application/pgp-keys': ['asc'],\n 'application/pgp-signature': ['sig', '*asc'],\n 'application/pics-rules': ['prf'],\n 'application/pkcs10': ['p10'],\n 'application/pkcs7-mime': ['p7m', 'p7c'],\n 'application/pkcs7-signature': ['p7s'],\n 'application/pkcs8': ['p8'],\n 'application/pkix-attr-cert': ['ac'],\n 'application/pkix-cert': ['cer'],\n 'application/pkix-crl': ['crl'],\n 'application/pkix-pkipath': ['pkipath'],\n 'application/pkixcmp': ['pki'],\n 'application/pls+xml': ['pls'],\n 'application/postscript': ['ai', 'eps', 'ps'],\n 'application/provenance+xml': ['provx'],\n 'application/pskc+xml': ['pskcxml'],\n 'application/raml+yaml': ['raml'],\n 'application/rdf+xml': ['rdf', 'owl'],\n 'application/reginfo+xml': ['rif'],\n 'application/relax-ng-compact-syntax': ['rnc'],\n 'application/resource-lists+xml': ['rl'],\n 'application/resource-lists-diff+xml': ['rld'],\n 'application/rls-services+xml': ['rs'],\n 'application/route-apd+xml': ['rapd'],\n 'application/route-s-tsid+xml': ['sls'],\n 'application/route-usd+xml': ['rusd'],\n 'application/rpki-ghostbusters': ['gbr'],\n 'application/rpki-manifest': ['mft'],\n 'application/rpki-roa': ['roa'],\n 'application/rsd+xml': ['rsd'],\n 'application/rss+xml': ['rss'],\n 'application/rtf': ['rtf'],\n 'application/sbml+xml': ['sbml'],\n 'application/scvp-cv-request': ['scq'],\n 'application/scvp-cv-response': ['scs'],\n 'application/scvp-vp-request': ['spq'],\n 'application/scvp-vp-response': ['spp'],\n 'application/sdp': ['sdp'],\n 'application/senml+xml': ['senmlx'],\n 'application/sensml+xml': ['sensmlx'],\n 'application/set-payment-initiation': ['setpay'],\n 'application/set-registration-initiation': ['setreg'],\n 'application/shf+xml': ['shf'],\n 'application/sieve': ['siv', 'sieve'],\n 'application/smil+xml': ['smi', 'smil'],\n 'application/sparql-query': ['rq'],\n 'application/sparql-results+xml': ['srx'],\n 'application/sql': ['sql'],\n 'application/srgs': ['gram'],\n 'application/srgs+xml': ['grxml'],\n 'application/sru+xml': ['sru'],\n 'application/ssdl+xml': ['ssdl'],\n 'application/ssml+xml': ['ssml'],\n 'application/swid+xml': ['swidtag'],\n 'application/tei+xml': ['tei', 'teicorpus'],\n 'application/thraud+xml': ['tfi'],\n 'application/timestamped-data': ['tsd'],\n 'application/toml': ['toml'],\n 'application/trig': ['trig'],\n 'application/ttml+xml': ['ttml'],\n 'application/ubjson': ['ubj'],\n 'application/urc-ressheet+xml': ['rsheet'],\n 'application/urc-targetdesc+xml': ['td'],\n 'application/voicexml+xml': ['vxml'],\n 'application/wasm': ['wasm'],\n 'application/watcherinfo+xml': ['wif'],\n 'application/widget': ['wgt'],\n 'application/winhlp': ['hlp'],\n 'application/wsdl+xml': ['wsdl'],\n 'application/wspolicy+xml': ['wspolicy'],\n 'application/xaml+xml': ['xaml'],\n 'application/xcap-att+xml': ['xav'],\n 'application/xcap-caps+xml': ['xca'],\n 'application/xcap-diff+xml': ['xdf'],\n 'application/xcap-el+xml': ['xel'],\n 'application/xcap-ns+xml': ['xns'],\n 'application/xenc+xml': ['xenc'],\n 'application/xfdf': ['xfdf'],\n 'application/xhtml+xml': ['xhtml', 'xht'],\n 'application/xliff+xml': ['xlf'],\n 'application/xml': ['xml', 'xsl', 'xsd', 'rng'],\n 'application/xml-dtd': ['dtd'],\n 'application/xop+xml': ['xop'],\n 'application/xproc+xml': ['xpl'],\n 'application/xslt+xml': ['*xsl', 'xslt'],\n 'application/xspf+xml': ['xspf'],\n 'application/xv+xml': ['mxml', 'xhvml', 'xvml', 'xvm'],\n 'application/yang': ['yang'],\n 'application/yin+xml': ['yin'],\n 'application/zip': ['zip'],\n 'application/zip+dotlottie': ['lottie'],\n 'audio/3gpp': ['*3gpp'],\n 'audio/aac': ['adts', 'aac'],\n 'audio/adpcm': ['adp'],\n 'audio/amr': ['amr'],\n 'audio/basic': ['au', 'snd'],\n 'audio/midi': ['mid', 'midi', 'kar', 'rmi'],\n 'audio/mobile-xmf': ['mxmf'],\n 'audio/mp3': ['*mp3'],\n 'audio/mp4': ['m4a', 'mp4a', 'm4b'],\n 'audio/mpeg': ['mpga', 'mp2', 'mp2a', 'mp3', 'm2a', 'm3a'],\n 'audio/ogg': ['oga', 'ogg', 'spx', 'opus'],\n 'audio/s3m': ['s3m'],\n 'audio/silk': ['sil'],\n 'audio/wav': ['wav'],\n 'audio/wave': ['*wav'],\n 'audio/webm': ['weba'],\n 'audio/xm': ['xm'],\n 'font/collection': ['ttc'],\n 'font/otf': ['otf'],\n 'font/ttf': ['ttf'],\n 'font/woff': ['woff'],\n 'font/woff2': ['woff2'],\n 'image/aces': ['exr'],\n 'image/apng': ['apng'],\n 'image/avci': ['avci'],\n 'image/avcs': ['avcs'],\n 'image/avif': ['avif'],\n 'image/bmp': ['bmp', 'dib'],\n 'image/cgm': ['cgm'],\n 'image/dicom-rle': ['drle'],\n 'image/dpx': ['dpx'],\n 'image/emf': ['emf'],\n 'image/fits': ['fits'],\n 'image/g3fax': ['g3'],\n 'image/gif': ['gif'],\n 'image/heic': ['heic'],\n 'image/heic-sequence': ['heics'],\n 'image/heif': ['heif'],\n 'image/heif-sequence': ['heifs'],\n 'image/hej2k': ['hej2'],\n 'image/ief': ['ief'],\n 'image/jaii': ['jaii'],\n 'image/jais': ['jais'],\n 'image/jls': ['jls'],\n 'image/jp2': ['jp2', 'jpg2'],\n 'image/jpeg': ['jpg', 'jpeg', 'jpe'],\n 'image/jph': ['jph'],\n 'image/jphc': ['jhc'],\n 'image/jpm': ['jpm', 'jpgm'],\n 'image/jpx': ['jpx', 'jpf'],\n 'image/jxl': ['jxl'],\n 'image/jxr': ['jxr'],\n 'image/jxra': ['jxra'],\n 'image/jxrs': ['jxrs'],\n 'image/jxs': ['jxs'],\n 'image/jxsc': ['jxsc'],\n 'image/jxsi': ['jxsi'],\n 'image/jxss': ['jxss'],\n 'image/ktx': ['ktx'],\n 'image/ktx2': ['ktx2'],\n 'image/pjpeg': ['jfif'],\n 'image/png': ['png'],\n 'image/sgi': ['sgi'],\n 'image/svg+xml': ['svg', 'svgz'],\n 'image/t38': ['t38'],\n 'image/tiff': ['tif', 'tiff'],\n 'image/tiff-fx': ['tfx'],\n 'image/webp': ['webp'],\n 'image/wmf': ['wmf'],\n 'message/disposition-notification': ['disposition-notification'],\n 'message/global': ['u8msg'],\n 'message/global-delivery-status': ['u8dsn'],\n 'message/global-disposition-notification': ['u8mdn'],\n 'message/global-headers': ['u8hdr'],\n 'message/rfc822': ['eml', 'mime', 'mht', 'mhtml'],\n 'model/3mf': ['3mf'],\n 'model/gltf+json': ['gltf'],\n 'model/gltf-binary': ['glb'],\n 'model/iges': ['igs', 'iges'],\n 'model/jt': ['jt'],\n 'model/mesh': ['msh', 'mesh', 'silo'],\n 'model/mtl': ['mtl'],\n 'model/obj': ['obj'],\n 'model/prc': ['prc'],\n 'model/step': ['step', 'stp', 'stpnc', 'p21', '210'],\n 'model/step+xml': ['stpx'],\n 'model/step+zip': ['stpz'],\n 'model/step-xml+zip': ['stpxz'],\n 'model/stl': ['stl'],\n 'model/u3d': ['u3d'],\n 'model/vrml': ['wrl', 'vrml'],\n 'model/x3d+binary': ['*x3db', 'x3dbz'],\n 'model/x3d+fastinfoset': ['x3db'],\n 'model/x3d+vrml': ['*x3dv', 'x3dvz'],\n 'model/x3d+xml': ['x3d', 'x3dz'],\n 'model/x3d-vrml': ['x3dv'],\n 'text/cache-manifest': ['appcache', 'manifest'],\n 'text/calendar': ['ics', 'ifb'],\n 'text/coffeescript': ['coffee', 'litcoffee'],\n 'text/css': ['css'],\n 'text/csv': ['csv'],\n 'text/html': ['html', 'htm', 'shtml'],\n 'text/jade': ['jade'],\n 'text/javascript': ['js', 'mjs'],\n 'text/jsx': ['jsx'],\n 'text/less': ['less'],\n 'text/markdown': ['md', 'markdown'],\n 'text/mathml': ['mml'],\n 'text/mdx': ['mdx'],\n 'text/n3': ['n3'],\n 'text/plain': ['txt', 'text', 'conf', 'def', 'list', 'log', 'in', 'ini'],\n 'text/richtext': ['rtx'],\n 'text/rtf': ['*rtf'],\n 'text/sgml': ['sgml', 'sgm'],\n 'text/shex': ['shex'],\n 'text/slim': ['slim', 'slm'],\n 'text/spdx': ['spdx'],\n 'text/stylus': ['stylus', 'styl'],\n 'text/tab-separated-values': ['tsv'],\n 'text/troff': ['t', 'tr', 'roff', 'man', 'me', 'ms'],\n 'text/turtle': ['ttl'],\n 'text/uri-list': ['uri', 'uris', 'urls'],\n 'text/vcard': ['vcard'],\n 'text/vtt': ['vtt'],\n 'text/wgsl': ['wgsl'],\n 'text/xml': ['*xml'],\n 'text/yaml': ['yaml', 'yml'],\n 'video/3gpp': ['3gp', '3gpp'],\n 'video/3gpp2': ['3g2'],\n 'video/h261': ['h261'],\n 'video/h263': ['h263'],\n 'video/h264': ['h264'],\n 'video/iso.segment': ['m4s'],\n 'video/jpeg': ['jpgv'],\n 'video/jpm': ['*jpm', '*jpgm'],\n 'video/mj2': ['mj2', 'mjp2'],\n 'video/mp2t': ['ts', 'm2t', 'm2ts', 'mts'],\n 'video/mp4': ['mp4', 'mp4v', 'mpg4'],\n 'video/mpeg': ['mpeg', 'mpg', 'mpe', 'm1v', 'm2v'],\n 'video/ogg': ['ogv'],\n 'video/quicktime': ['qt', 'mov'],\n 'video/webm': ['webm'],\n};\nObject.freeze(types);\nexport default types;\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _Mime_extensionToType, _Mime_typeToExtension, _Mime_typeToExtensions;\nclass Mime {\n constructor(...args) {\n _Mime_extensionToType.set(this, new Map());\n _Mime_typeToExtension.set(this, new Map());\n _Mime_typeToExtensions.set(this, new Map());\n for (const arg of args) {\n this.define(arg);\n }\n }\n define(typeMap, force = false) {\n for (let [type, extensions] of Object.entries(typeMap)) {\n type = type.toLowerCase();\n extensions = extensions.map((ext) => ext.toLowerCase());\n if (!__classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").has(type)) {\n __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").set(type, new Set());\n }\n const allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type);\n let first = true;\n for (let extension of extensions) {\n const starred = extension.startsWith('*');\n extension = starred ? extension.slice(1) : extension;\n allExtensions?.add(extension);\n if (first) {\n __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").set(type, extension);\n }\n first = false;\n if (starred)\n continue;\n const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(extension);\n if (currentType && currentType != type && !force) {\n throw new Error(`\"${type} -> ${extension}\" conflicts with \"${currentType} -> ${extension}\". Pass \\`force=true\\` to override this definition.`);\n }\n __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").set(extension, type);\n }\n }\n return this;\n }\n getType(path) {\n if (typeof path !== 'string')\n return null;\n const last = path.replace(/^.*[/\\\\]/s, '').toLowerCase();\n const ext = last.replace(/^.*\\./s, '').toLowerCase();\n const hasPath = last.length < path.length;\n const hasDot = ext.length < last.length - 1;\n if (!hasDot && hasPath)\n return null;\n return __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(ext) ?? null;\n }\n getExtension(type) {\n if (typeof type !== 'string')\n return null;\n type = type?.split?.(';')[0];\n return ((type && __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").get(type.trim().toLowerCase())) ?? null);\n }\n getAllExtensions(type) {\n if (typeof type !== 'string')\n return null;\n return __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type.toLowerCase()) ?? null;\n }\n _freeze() {\n this.define = () => {\n throw new Error('define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances');\n };\n Object.freeze(this);\n for (const extensions of __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").values()) {\n Object.freeze(extensions);\n }\n return this;\n }\n _getTestState() {\n return {\n types: __classPrivateFieldGet(this, _Mime_extensionToType, \"f\"),\n extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\"),\n };\n }\n}\n_Mime_extensionToType = new WeakMap(), _Mime_typeToExtension = new WeakMap(), _Mime_typeToExtensions = new WeakMap();\nexport default Mime;\n","import otherTypes from '../types/other.js';\nimport standardTypes from '../types/standard.js';\nimport Mime from './Mime.js';\nexport { default as Mime } from './Mime.js';\nexport default new Mime(standardTypes, otherTypes)._freeze();\n","import { readFileSync } from \"node:fs\";\nimport { isAbsolute, resolve, sep } from \"node:path\";\nimport { TextDecoder } from \"node:util\";\nimport ignore from \"ignore\";\nimport mime from \"mime\";\nimport {\n\tCF_ASSETS_IGNORE_FILENAME,\n\tHEADERS_FILENAME,\n\tREDIRECTS_FILENAME,\n} from \"./constants\";\nimport type { PathOrFileDescriptor } from \"node:fs\";\n\n/** normalises sep for windows and prefix with `/` */\nexport const normalizeFilePath = (relativeFilepath: string) => {\n\tif (isAbsolute(relativeFilepath)) {\n\t\tthrow new Error(`Expected relative path`);\n\t}\n\treturn \"/\" + relativeFilepath.split(sep).join(\"/\");\n};\n\nexport const getContentType = (absFilePath: string) => {\n\tlet contentType = mime.getType(absFilePath);\n\tif (\n\t\tcontentType &&\n\t\tcontentType.startsWith(\"text/\") &&\n\t\t!contentType.includes(\"charset\")\n\t) {\n\t\tcontentType = `${contentType}; charset=utf-8`;\n\t}\n\treturn contentType;\n};\n\n/**\n * Generate a function that can match relative filepaths against a list of gitignore formatted patterns.\n */\nexport function createPatternMatcher(\n\tpatterns: string[],\n\texclude: boolean\n): (filePath: string) => boolean {\n\tif (patterns.length === 0) {\n\t\treturn (_filePath) => !exclude;\n\t} else {\n\t\tconst ignorer = ignore().add(patterns);\n\t\treturn (filePath) => ignorer.test(filePath).ignored;\n\t}\n}\n\nexport function thrownIsDoesNotExistError(\n\tthrown: unknown\n): thrown is Error & { code: \"ENOENT\" } {\n\treturn (\n\t\tthrown instanceof Error && \"code\" in thrown && thrown.code === \"ENOENT\"\n\t);\n}\n\nexport function maybeGetFile(filePath: PathOrFileDescriptor) {\n\ttry {\n\t\treturn readFileSync(filePath, \"utf8\");\n\t} catch (e: unknown) {\n\t\tif (!thrownIsDoesNotExistError(e)) {\n\t\t\tthrow e;\n\t\t}\n\t}\n}\n\n/** An ignore file whose encoding cannot be used to match asset paths. */\nexport class InvalidAssetsIgnoreError extends Error {\n\tconstructor(filePath: string) {\n\t\tsuper(\n\t\t\t`The .assetsignore file at \"${filePath}\" must be UTF-8 encoded and must not contain null characters. Save the file as UTF-8 and try again.`\n\t\t);\n\t\tthis.name = \"InvalidAssetsIgnoreError\";\n\t}\n}\n\n/** Read ignore patterns without silently replacing undecodable characters. */\nfunction readAssetsIgnoreFile(filePath: string): string | undefined {\n\tlet contents: Buffer;\n\ttry {\n\t\tcontents = readFileSync(filePath);\n\t} catch (error) {\n\t\tif (thrownIsDoesNotExistError(error)) {\n\t\t\treturn;\n\t\t}\n\t\tthrow error;\n\t}\n\n\ttry {\n\t\tconst text = new TextDecoder(\"utf-8\", { fatal: true }).decode(contents);\n\t\t// BOM-less UTF-16 can be valid UTF-8 bytes but cannot form usable patterns.\n\t\tif (text.includes(\"\\0\")) {\n\t\t\tthrow new Error(\"Ignore patterns contain a null character.\");\n\t\t}\n\t\treturn text;\n\t} catch {\n\t\tthrow new InvalidAssetsIgnoreError(filePath);\n\t}\n}\n\n/**\n * Create a function for filtering out ignored assets.\n *\n * The generated function takes an asset path, relative to the asset directory,\n * and returns true if the asset should not be ignored.\n */\nexport async function createAssetsIgnoreFunction(dir: string) {\n\tconst cfAssetIgnorePath = resolve(dir, CF_ASSETS_IGNORE_FILENAME);\n\n\tconst ignorePatterns = [\n\t\t// Ignore the `.assetsignore` file and other metafiles by default.\n\t\t// The ignore lib expects unix-style paths for its patterns\n\t\t`/${CF_ASSETS_IGNORE_FILENAME}`,\n\t\t`/${REDIRECTS_FILENAME}`,\n\t\t`/${HEADERS_FILENAME}`,\n\t];\n\n\tlet assetsIgnoreFilePresent = false;\n\tconst assetsIgnore = readAssetsIgnoreFile(cfAssetIgnorePath);\n\tif (assetsIgnore !== undefined) {\n\t\tassetsIgnoreFilePresent = true;\n\t\tignorePatterns.push(...assetsIgnore.split(\"\\n\"));\n\t}\n\n\treturn {\n\t\tassetsIgnoreFunction: createPatternMatcher(ignorePatterns, true),\n\t\tassetsIgnoreFilePresent,\n\t};\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport { miniflare } from './miniflare.js';\nimport { constructHeaders, constructRedirects } from '../workers-sdk/packages/workers-shared/utils/configuration/constructConfiguration.js';\nimport { parseHeaders } from '../workers-sdk/packages/workers-shared/utils/configuration/parseHeaders.js';\nimport { parseRedirects } from '../workers-sdk/packages/workers-shared/utils/configuration/parseRedirects.js';\nimport { getContentType } from '../workers-sdk/packages/workers-shared/utils/helpers.js';\n\nimport type { AssetConfig, RouterConfig } from '../workers-sdk/packages/workers-shared/utils/types.js';\nimport type { Compiler } from '@rspack/core';\n\ntype Logger = ReturnType<Compiler['getInfrastructureLogger']>;\ntype MiniflareRequest = InstanceType<typeof miniflare.Request>;\n\n/** The slice of rspack's output filesystem we read from; the dev server swaps in an in-memory one. */\nexport interface ReadableFileSystem {\n\treadFile: (filePath: string, callback: (error: NodeJS.ErrnoException | null, data?: Buffer | string) => void) => void;\n\tstat: (filePath: string, callback: (error: NodeJS.ErrnoException | null, stats?: { isFile: () => boolean; }) => void) => void;\n}\n\n/** The router and asset Worker configs wrangler generates for a Worker with assets. */\nexport interface AssetWorkerOptions {\n\trouterConfig: RouterConfig;\n\tassetConfig: AssetConfig;\n}\n\n/** The contents of the build's `_headers` and `_redirects`, which the asset Worker reads when it starts. */\nexport interface AssetRules {\n\theaders: string | undefined;\n\tredirects: string | undefined;\n}\n\nexport const ROUTER_WORKER_NAME = '__rspack-plugin-cloudflare-router__';\nexport const ASSET_WORKER_NAME = '__rspack-plugin-cloudflare-assets__';\n// the date and flags the Vite plugin runs the same Workers with\nconst INTERNAL_WORKERS_COMPATIBILITY_DATE = '2024-10-04';\n// configuration rather than content, which wrangler never uploads as assets\nconst RESERVED_FILES = new Set(['/_headers', '/_redirects', '/.assetsignore']);\n\n// Miniflare's JSON bindings reject the undefined values wrangler leaves on options that aren't set\nfunction toJsonBinding(config: AssetConfig | RouterConfig) {\n\treturn Object.fromEntries(Object.entries(config).filter(([, value]) => value !== undefined));\n}\n\nfunction getInternalWorkerPath(name: string) {\n\treturn fileURLToPath(new URL(`workers/${name}/index.js`, import.meta.url));\n}\n\nfunction statFile(fileSystem: ReadableFileSystem, filePath: string) {\n\treturn new Promise<boolean>((resolve) => {\n\t\tfileSystem.stat(filePath, (error, stats) => {\n\t\t\tresolve(!error && Boolean(stats?.isFile()));\n\t\t});\n\t});\n}\n\nfunction readFile(fileSystem: ReadableFileSystem, filePath: string) {\n\treturn new Promise<Buffer>((resolve, reject) => {\n\t\tfileSystem.readFile(filePath, (error, data) => {\n\t\t\tif (error || data === undefined) {\n\t\t\t\treject(error ?? new Error(`Could not read ${filePath}`));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolve(Buffer.from(data));\n\t\t});\n\t});\n}\n\n/**\n * Finds asset files for the asset Worker, reading the compiler's output filesystem first so files only emitted in\n * memory by the dev server are visible, then the assets directory on disk.\n */\nexport class DevAssets {\n\treadonly #roots: string[];\n\treadonly #getOutputFileSystem: () => ReadableFileSystem | undefined;\n\treadonly #waitUntilValid: () => Promise<void>;\n\n\tconstructor(options: {\n\t\tdirectory: string;\n\t\t/** More directories served at the root, checked after `directory`. */\n\t\textraDirectories: string[];\n\t\tgetOutputFileSystem: () => ReadableFileSystem | undefined;\n\t\twaitUntilValid: () => Promise<void>;\n\t}) {\n\t\tthis.#roots = [options.directory, ...options.extraDirectories];\n\t\tthis.#getOutputFileSystem = options.getOutputFileSystem;\n\t\tthis.#waitUntilValid = options.waitUntilValid;\n\t}\n\n\tasync #find(pathname: string) {\n\t\tconst outputFileSystem = this.#getOutputFileSystem();\n\t\tfor (const root of this.#roots) {\n\t\t\tconst filePath = path.join(root, pathname);\n\t\t\t// path.join normalizes `..`, so anything still escaping the root is a traversal attempt\n\t\t\tif (!filePath.startsWith(root + path.sep)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (outputFileSystem && await statFile(outputFileSystem, filePath)) {\n\t\t\t\treturn { fileSystem: outputFileSystem, filePath };\n\t\t\t}\n\t\t\tif (await statFile(fs, filePath)) {\n\t\t\t\treturn { fileSystem: fs, filePath };\n\t\t\t}\n\t\t}\n\t}\n\n\tasync #readText(pathname: string) {\n\t\tconst file = await this.#find(pathname);\n\t\treturn file && String(await readFile(file.fileSystem, file.filePath));\n\t}\n\n\tasync readRules(): Promise<AssetRules> {\n\t\tawait this.#waitUntilValid();\n\t\treturn { headers: await this.#readText('/_headers'), redirects: await this.#readText('/_redirects') };\n\t}\n\n\t/** Answers the asset Worker's lookups, using the pathname itself as the ETag. */\n\tasync handle(request: MiniflareRequest) {\n\t\tconst url = new URL(request.url);\n\t\tconst pathname = url.searchParams.get(url.pathname === '/exists' ? 'pathname' : 'eTag') ?? '';\n\t\tawait this.#waitUntilValid();\n\t\tconst file = RESERVED_FILES.has(pathname) ? undefined : await this.#find(pathname);\n\t\tif (url.pathname === '/exists') {\n\t\t\treturn miniflare.Response.json(file ? pathname : null);\n\t\t}\n\t\tif (!file) {\n\t\t\treturn new miniflare.Response(null, { status: 404 });\n\t\t}\n\t\tconst body = await readFile(file.fileSystem, file.filePath);\n\t\t// the content types wrangler gives assets when it uploads them\n\t\treturn new miniflare.Response(body, { headers: { 'Content-Type': getContentType(file.filePath) ?? 'application/octet-stream' } });\n\t}\n}\n\n/** Adds the build's `_headers` and `_redirects` to wrangler's asset config, the way Miniflare does for wrangler dev. */\nexport function getAssetConfig(options: AssetWorkerOptions, rules: AssetRules, logger: Logger): AssetConfig {\n\tconst { assetConfig, routerConfig } = options;\n\tconst parserLogger = {\n\t\t// the count of valid rules on every restart is noise; invalid ones still warn\n\t\tdebug: () => {},\n\t\tlog: () => {},\n\t\tinfo: (message: string) => logger.info(message),\n\t\twarn: (message: string) => logger.warn(message),\n\t\terror: (error: Error) => logger.error(error.message),\n\t};\n\tconst config: AssetConfig = { ...assetConfig, debug: true, has_static_routing: Boolean(routerConfig.static_routing) };\n\tif (rules.redirects !== undefined) {\n\t\tconst redirects = parseRedirects(rules.redirects, { htmlHandling: assetConfig.html_handling });\n\t\tObject.assign(config, constructRedirects({ redirects, redirectsFile: '_redirects', logger: parserLogger }));\n\t}\n\tif (rules.headers !== undefined) {\n\t\tObject.assign(config, constructHeaders({ headers: parseHeaders(rules.headers), headersFile: '_headers', logger: parserLogger }));\n\t}\n\treturn config;\n}\n\n/** Miniflare options for Cloudflare's router and asset Workers, with assets coming from `assets` instead of a manifest. */\nexport function getAssetWorkers(options: { routerConfig: RouterConfig; assetConfig: AssetConfig; userWorkerName: string | undefined; assets: DevAssets; }) {\n\tconst routerPath = getInternalWorkerPath('router-worker');\n\tconst assetPath = getInternalWorkerPath('asset-worker');\n\treturn [\n\t\t{\n\t\t\tname: ROUTER_WORKER_NAME,\n\t\t\tcompatibilityDate: INTERNAL_WORKERS_COMPATIBILITY_DATE,\n\t\t\t// the outer entrypoint reaches the inner one through ctx.exports\n\t\t\tcompatibilityFlags: ['enable_ctx_exports'],\n\t\t\tmodulesRoot: path.dirname(routerPath),\n\t\t\tmodules: [{ type: 'ESModule', path: routerPath }],\n\t\t\tbindings: { CONFIG: toJsonBinding(options.routerConfig) },\n\t\t\tserviceBindings: {\n\t\t\t\tASSET_WORKER: ASSET_WORKER_NAME,\n\t\t\t\t...(options.userWorkerName !== undefined && { USER_WORKER: options.userWorkerName }),\n\t\t\t},\n\t\t\t// internal to this session, so other dev sessions shouldn't see them in the dev registry\n\t\t\tunsafeRegisterWorker: false,\n\t\t},\n\t\t{\n\t\t\tname: ASSET_WORKER_NAME,\n\t\t\tcompatibilityDate: INTERNAL_WORKERS_COMPATIBILITY_DATE,\n\t\t\tmodulesRoot: path.dirname(assetPath),\n\t\t\tmodules: [{ type: 'ESModule', path: assetPath }],\n\t\t\tbindings: { CONFIG: toJsonBinding(options.assetConfig) },\n\t\t\tserviceBindings: { __RSPACK_ASSETS__: (request: MiniflareRequest) => options.assets.handle(request) },\n\t\t\tunsafeRegisterWorker: false,\n\t\t},\n\t];\n}\n","import path from 'node:path';\n\nimport {\n\tcleanupContainers,\n\tcreateContainerDevPlan,\n\tprepareContainerImagesForDev,\n\tresolveDockerHost,\n} from '@cloudflare/containers-shared';\n\nimport type { WorkerConfig } from './options.js';\nimport type { ContainerDevOptions, ViteLogger } from '@cloudflare/containers-shared';\n\nexport { generateContainerBuildId } from '@cloudflare/containers-shared';\n\n/** `WRANGLER_DOCKER_BIN`, like wrangler, so both find the same Docker. */\nexport function getDockerPath() {\n\treturn process.env.WRANGLER_DOCKER_BIN || 'docker';\n}\n\n/** The images a Worker's Containers need, tagged to match the Durable Object options wrangler generates with the same build id. */\nexport function getContainerOptions(config: WorkerConfig, containerBuildId: string): ContainerDevOptions[] {\n\tconst plan = createContainerDevPlan({\n\t\tcontainers: config.containers,\n\t\texports: config.exports,\n\t\tconfigPath: config.configPath,\n\t\tcontainerBuildId,\n\t});\n\treturn plan?.containerOptions ?? [];\n}\n\n/** The Docker endpoint workerd starts containers through; Miniflare picks the egress sidecar image itself. */\nexport function getContainerEngine(config: WorkerConfig, dockerPath: string) {\n\treturn config.dev.container_engine ?? resolveDockerHost(dockerPath);\n}\n\n/** Builds or pulls each image and the egress sidecar the way wrangler dev does, including its Windows and Docker checks. */\nexport async function prepareContainerImages(options: { config: WorkerConfig; dockerPath: string; containerOptions: ContainerDevOptions[]; logger: ViteLogger; }) {\n\tconst { config } = options;\n\tawait prepareContainerImagesForDev({\n\t\tdockerPath: options.dockerPath,\n\t\tcontainerOptions: options.containerOptions,\n\t\tonContainerImagePreparationStart: () => {},\n\t\tonContainerImagePreparationEnd: () => {},\n\t\tlogger: options.logger,\n\t\tcomplianceConfig: config,\n\t\tconfigFileName: path.basename(config.configPath ?? 'wrangler.json'),\n\t\tregistryConfigureCommand: 'wrangler containers registries configure',\n\t});\n}\n\n/** Force-removes containers started from these images; synchronous so it can also run while the process exits. */\nexport function removeContainers(dockerPath: string, tags: Set<string>) {\n\tif (tags.size > 0) {\n\t\tcleanupContainers(dockerPath, tags);\n\t}\n}\n","import { fileURLToPath } from 'node:url';\n\nimport type { ResolvedWorker } from './config.js';\n\nconst RUNTIME_PATH = fileURLToPath(new URL('../runtime/dev-runtime.js', import.meta.url));\n\n// these names are shared with runtime/dev-runtime.js\nexport const HMR_RUNNER_CLASS = '__RSPACK_HMR_RUNNER__';\nexport const HMR_TOKEN_BINDING = '__RSPACK_HMR_TOKEN__';\nexport const HMR_HEADER = 'x-rspack-plugin-cloudflare-hmr';\n\nfunction toSpecifier(filePath: string) {\n\treturn JSON.stringify(filePath.replaceAll('\\\\', '/'));\n}\n\n/** Export names we can know before building: `default` plus the Durable Object and Workflow classes this Worker owns. */\nexport function getConfiguredExports(worker: ResolvedWorker) {\n\tconst names = new Set(['default']);\n\tfor (const binding of worker.config.durable_objects.bindings) {\n\t\tif (!binding.script_name) {\n\t\t\tnames.add(binding.class_name);\n\t\t}\n\t}\n\tfor (const workflow of worker.config.workflows) {\n\t\tif (!workflow.script_name) {\n\t\t\tnames.add(workflow.class_name);\n\t\t}\n\t}\n\treturn [...names].toSorted((left, right) => left.localeCompare(right));\n}\n\n/**\n * Source for the dev-only entry around `main`. It accepts hot updates to `main` so rspack re-evaluates the changed\n * modules in place, and re-exports each of the user's exports through a wrapper that always calls the current code.\n */\nexport function createDevEntrySource(main: string, exportNames: string[]) {\n\tconst mainSpecifier = toSpecifier(main);\n\tconst lines = [\n\t\t`import * as worker from ${mainSpecifier};`,\n\t\t`import { initialize, wrapExport, RspackHmrRunner } from ${toSpecifier(RUNTIME_PATH)};`,\n\t\t'initialize(() => worker);',\n\t\t`if (import.meta.webpackHot) import.meta.webpackHot.accept(${mainSpecifier});`,\n\t\t`export { RspackHmrRunner as ${HMR_RUNNER_CLASS} };`,\n\t];\n\tfor (const [index, name] of exportNames.entries()) {\n\t\t// string export names cover anything the user exported, even names that aren't valid identifiers\n\t\tlines.push(`const export${index} = wrapExport(${JSON.stringify(name)});`, `export { export${index} as ${JSON.stringify(name)} };`);\n\t}\n\treturn `${lines.join('\\n')}\\n`;\n}\n","import { randomUUID } from 'node:crypto';\nimport { readFileSync } from 'node:fs';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\n\nimport { maybeStartOrUpdateRemoteProxySession, unstable_convertConfigBindingsToStartWorkerBindings, unstable_getMiniflareWorkerOptions } from 'wrangler';\n\nimport { generateContainerBuildId, getContainerOptions } from './containers.js';\nimport {\n\tHMR_HEADER,\n\tHMR_RUNNER_CLASS,\n\tHMR_TOKEN_BINDING,\n\tcreateDevEntrySource,\n\tgetConfiguredExports,\n} from './dev-entry.js';\nimport { miniflare } from './miniflare.js';\nimport { IMPORTED_ASSETS_DIR, createWorkerConfig } from './worker-config.js';\n\nimport type { AssetWorkerOptions } from './assets.js';\nimport type { ResolvedWorker } from './config.js';\nimport type { CloudflarePluginOptions } from './options.js';\nimport type { AdditionalModulesPlugin, VirtualModules } from './worker-config.js';\nimport type {\n\tCompiler,\n\tMultiStats,\n\tStats,\n\tWatching,\n} from '@rspack/core';\n\ntype Logger = ReturnType<Compiler['getInfrastructureLogger']>;\ntype Miniflare = InstanceType<typeof miniflare.Miniflare>;\ntype RemoteProxySessionData = Awaited<ReturnType<typeof maybeStartOrUpdateRemoteProxySession>>;\n\n// with module output, rspack writes both update chunks and manifests (`*.hot-update.json.mjs`) as ES modules\nconst HOT_UPDATE_RE = /\\.hot-update\\.(?:json\\.)?mjs$/;\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** The export names rspack found on `main`, or undefined when it couldn't tell, like for CommonJS. */\nfunction getProvidedExports(stats: Stats, main: string) {\n\tconst { modules = [] } = stats.toJson({ all: false, modules: true, providedExports: true });\n\tconst mainModule = modules.find(module => module.nameForCondition && path.resolve(module.nameForCondition) === path.resolve(main));\n\tconst provided = mainModule?.providedExports;\n\treturn Array.isArray(provided) ? provided.map(String).toSorted((left, right) => left.localeCompare(right)) : undefined;\n}\n\ninterface DevWorkerEvents {\n\t/** A build began, so requests should wait for it. */\n\tonBuildStart: (worker: DevWorker) => void;\n\t/** A build finished, successfully or not; `buildError` says which. */\n\tonBuildDone: (worker: DevWorker) => Promise<void>;\n}\n\n/** One Worker in a dev session: its rspack watcher, its hot updates, and its slice of the Miniflare config. */\nexport class DevWorker {\n\treadonly #compiler: Compiler;\n\treadonly #options: CloudflarePluginOptions;\n\treadonly #logger: Logger;\n\treadonly #events: DevWorkerEvents;\n\treadonly #resolve: () => Promise<ResolvedWorker>;\n\t// proves an update request came from this session rather than a browser that happened to send the header\n\treadonly #hmrToken = randomUUID();\n\t#resolved: ResolvedWorker;\n\t#watching: Watching | undefined;\n\t#virtualModules: VirtualModules | undefined;\n\t#additionalModules: AdditionalModulesPlugin | undefined;\n\t// the names the dev entry re-exports, which workerd bound when the Worker last (re)started\n\t#exportNames: string[] = [];\n\t#loadedModules = '';\n\t#builtModules: { type: string; path: string; contents: Buffer; }[] = [];\n\t#restartReason: string | undefined = 'it is starting';\n\t#remoteProxy: RemoteProxySessionData = null;\n\t// new on every (re)start so changed Dockerfiles get fresh image tags instead of reusing stale images\n\t#containerBuildId = '';\n\tbuildError: string | undefined;\n\tbuilding = true;\n\n\tconstructor(options: { compiler: Compiler; resolved: ResolvedWorker; resolve: () => Promise<ResolvedWorker>; pluginOptions: CloudflarePluginOptions; logger: Logger; events: DevWorkerEvents; }) {\n\t\tthis.#compiler = options.compiler;\n\t\tthis.#options = options.pluginOptions;\n\t\tthis.#logger = options.logger;\n\t\tthis.#events = options.events;\n\t\tthis.#resolve = options.resolve;\n\t\tthis.#resolved = options.resolved;\n\t}\n\n\t// on disk rather than in memory so workerd can read the bundle's source maps for stack traces\n\tget #outputDir() {\n\t\treturn path.join(this.#resolved.rootDir, '.wrangler', 'rspack', this.#resolved.name);\n\t}\n\n\t// a virtual module, so it only needs a path that resolves imports the same way main does\n\tget #entryPath() {\n\t\treturn path.join(this.#resolved.rootDir, '.wrangler', 'tmp', `rspack-${this.#resolved.name}`, 'dev-entry.js');\n\t}\n\n\t/** Records a finished build, returning false when it triggered another build that should be waited for instead. */\n\t#handleBuild(main: string, error: Error | null, stats: Stats | MultiStats | undefined) {\n\t\tif (error || !stats || stats.hasErrors() || !('compilation' in stats)) {\n\t\t\tthis.buildError = error?.message ?? stats?.toString({ preset: 'errors-only', colors: false }) ?? 'Unknown error';\n\t\t\treturn true;\n\t\t}\n\t\tconst exportNames = getProvidedExports(stats, main);\n\t\tif (exportNames && exportNames.join(',') !== this.#exportNames.join(',')) {\n\t\t\t// the dev entry re-exports by name and workerd binds exports at startup, so regenerate it and restart on the rebuild\n\t\t\tthis.#exportNames = exportNames;\n\t\t\tthis.#restartReason ??= 'its exports changed';\n\t\t\tthis.#virtualModules?.writeModule(this.#entryPath, createDevEntrySource(main, exportNames));\n\t\t\tthis.#rebuildEntry();\n\t\t\treturn false;\n\t\t}\n\t\tconst entryExports = getProvidedExports(stats, this.#entryPath)?.filter(name => name !== HMR_RUNNER_CLASS);\n\t\tif (entryExports && entryExports.join(',') !== this.#exportNames.join(',')) {\n\t\t\t// workerd binds whatever the built entry exports, so a build that missed the rewrite must not reach it\n\t\t\tthis.#rebuildEntry();\n\t\t\treturn false;\n\t\t}\n\t\tthis.buildError = undefined;\n\t\treturn true;\n\t}\n\n\t// the watcher is paused while a build callback runs and can drop the virtual entry's change event, and a bare\n\t// invalidate() then rebuilds with the old entry, so name the changed file outright\n\t#rebuildEntry() {\n\t\tthis.#watching?.invalidateWithChangesAndRemovals(new Set([this.#entryPath]));\n\t}\n\n\t#getModules() {\n\t\tconst modules = [{ type: 'ESModule', path: path.join(this.#outputDir, 'index.js') }];\n\t\tfor (const { fileName, type } of this.#additionalModules?.modules ?? []) {\n\t\t\tmodules.push({ type, path: path.join(this.#outputDir, fileName) });\n\t\t}\n\t\treturn modules;\n\t}\n\n\t// read while the build callback runs, since the next build can start rewriting these files before Miniflare loads them\n\t#readBuiltModules() {\n\t\treturn this.#getModules().map((module) => {\n\t\t\treturn { ...module, contents: readFileSync(module.path) };\n\t\t});\n\t}\n\n\t/** Starts or refreshes the proxy for bindings marked `remote: true`, which wrangler only opens when some exist. */\n\tasync #getRemoteProxyConnectionString() {\n\t\tif (this.#options.remoteBindings === false) {\n\t\t\treturn;\n\t\t}\n\t\tconst { config } = this.#resolved;\n\t\tthis.#remoteProxy = await maybeStartOrUpdateRemoteProxySession({\n\t\t\tname: config.name,\n\t\t\tbindings: unstable_convertConfigBindingsToStartWorkerBindings(config) ?? {},\n\t\t\taccount_id: config.account_id,\n\t\t\tcomplianceRegion: config.compliance_region,\n\t\t}, this.#remoteProxy);\n\t\treturn this.#remoteProxy?.session.remoteProxyConnectionString;\n\t}\n\n\tasync #closeWatcher() {\n\t\tconst watching = this.#watching;\n\t\tthis.#watching = undefined;\n\t\tawait new Promise<void>((resolve) => {\n\t\t\tif (watching) {\n\t\t\t\twatching.close(() => resolve());\n\t\t\t} else {\n\t\t\t\tresolve();\n\t\t\t}\n\t\t});\n\t}\n\n\tget resolved() {\n\t\treturn this.#resolved;\n\t}\n\n\tget name() {\n\t\treturn this.#resolved.name;\n\t}\n\n\t/** Why the next build needs a restart instead of a hot update, if it does. */\n\tget restartReason() {\n\t\tif (this.#restartReason) {\n\t\t\treturn this.#restartReason;\n\t\t}\n\t\tif (JSON.stringify(this.#getModules()) !== this.#loadedModules) {\n\t\t\treturn 'its .wasm or .bin modules changed';\n\t\t}\n\t}\n\n\tstart() {\n\t\tconst { main } = this.#resolved;\n\t\tthis.#containerBuildId = generateContainerBuildId();\n\t\tif (!main) {\n\t\t\tthis.building = false;\n\t\t\treturn;\n\t\t}\n\t\tthis.building = true;\n\t\tthis.#exportNames = getConfiguredExports(this.#resolved);\n\t\tconst { config, virtualModules, additionalModules } = createWorkerConfig({\n\t\t\tcompiler: this.#compiler,\n\t\t\tworker: this.#resolved,\n\t\t\tpluginOptions: this.#options,\n\t\t\toutputDir: this.#outputDir,\n\t\t\tentry: this.#entryPath,\n\t\t\tentrySource: createDevEntrySource(main, this.#exportNames),\n\t\t\tmode: 'development',\n\t\t\thot: true,\n\t\t\t// a prefix per Worker, so Miniflare's module fallback can tell whose hot update is being imported\n\t\t\tpublicPath: `/${this.name}/`,\n\t\t});\n\t\tthis.#virtualModules = virtualModules;\n\t\tthis.#additionalModules = additionalModules;\n\t\tconst workerCompiler = this.#compiler.rspack.rspack(config);\n\t\tworkerCompiler.hooks.invalid.tap('rspack-plugin-cloudflare', () => {\n\t\t\tthis.building = true;\n\t\t\tthis.#events.onBuildStart(this);\n\t\t});\n\t\tthis.#watching = workerCompiler.watch({}, (error, stats) => {\n\t\t\tif (this.#handleBuild(main, error, stats)) {\n\t\t\t\tif (!this.buildError) {\n\t\t\t\t\tthis.#builtModules = this.#readBuiltModules();\n\t\t\t\t}\n\t\t\t\tthis.building = false;\n\t\t\t\tthis.#events.onBuildDone(this).catch((loadError: unknown) => {\n\t\t\t\t\tthis.#logger.error(`Worker \"${this.name}\" failed to load: ${String(loadError)}`);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\t/** Re-reads the config and rebuilds from scratch, since anything from `main` to bindings may have changed. */\n\tasync reload() {\n\t\t// read first, so a broken config leaves the current build running rather than stopping it\n\t\tconst resolved = await this.#resolve();\n\t\tawait this.#closeWatcher();\n\t\tthis.#resolved = resolved;\n\t\tthis.#restartReason = 'its config changed';\n\t\tthis.start();\n\t}\n\n\t/** Records that Miniflare is now running this Worker's latest build. */\n\tmarkLoaded() {\n\t\tthis.#restartReason = undefined;\n\t\tthis.#loadedModules = JSON.stringify(this.#getModules());\n\t}\n\n\t/** Asks the running Worker to apply its pending hot update, through a fetch its dev entry recognizes by token. */\n\tasync applyHotUpdate(mf: Miniflare): Promise<{ reload: boolean; reason?: string; }> {\n\t\tconst response = await mf.dispatchFetch('http://localhost/', {\n\t\t\theaders: { [HMR_HEADER]: this.#hmrToken, [miniflare.CoreHeaders.ROUTE_OVERRIDE]: this.name },\n\t\t});\n\t\t// a Worker that can't answer properly gets restarted rather than leaving dev broken\n\t\tconst result: unknown = await response.json().catch(() => {});\n\t\tif (isPlainObject(result) && result.reload === false) {\n\t\t\treturn { reload: false };\n\t\t}\n\t\tconst reason = isPlainObject(result) && typeof result.reason === 'string' ? result.reason : `the update request failed (${response.status})`;\n\t\treturn { reload: true, reason };\n\t}\n\n\t/** Reads one of this Worker's hot-update modules, given its path below the Worker's public path. */\n\tasync readHotUpdate(relativePath: string) {\n\t\tconst filePath = path.join(this.#outputDir, relativePath);\n\t\t// anything other than a hot update is a genuinely missing import, which should fail like it would in production\n\t\tif (!HOT_UPDATE_RE.test(filePath) || !filePath.startsWith(this.#outputDir + path.sep)) {\n\t\t\treturn;\n\t\t}\n\t\treturn fs.readFile(filePath, 'utf8');\n\t}\n\n\t/** Where assets imported by the Worker's code are emitted, laid out the way they're served. */\n\tget importedAssetsDir() {\n\t\treturn path.join(this.#outputDir, IMPORTED_ASSETS_DIR);\n\t}\n\n\t/**\n\t * This Worker's Miniflare options, any external Workers wrangler adds for its bindings, the container images it needs,\n\t * and its asset options, which configure the router and asset Workers the session runs.\n\t */\n\tasync getMiniflareOptions(extraServiceBindings: Record<string, unknown>, inspectorEnabled: boolean) {\n\t\tconst { config, environment } = this.#resolved;\n\t\tconst remoteProxyConnectionString = await this.#getRemoteProxyConnectionString();\n\t\tconst { workerOptions, externalWorkers } = unstable_getMiniflareWorkerOptions(config, environment, {\n\t\t\tremoteProxyConnectionString,\n\t\t\tcontainerBuildId: this.#containerBuildId,\n\t\t});\n\t\t// assets are left out of the Worker because the session runs the router and asset Workers itself\n\t\tconst { modulesRules: _modulesRules, assets, ...options } = workerOptions;\n\t\tconst containersEnabled = Boolean(config.containers?.length) && config.dev.enable_containers;\n\t\tlet assetWorkerOptions: AssetWorkerOptions | undefined;\n\t\tif (assets) {\n\t\t\tconst { routerConfig, assetConfig } = assets as AssetWorkerOptions;\n\t\t\tassetWorkerOptions = { routerConfig, assetConfig };\n\t\t}\n\t\treturn {\n\t\t\tassetWorkerOptions,\n\t\t\texternalWorkers,\n\t\t\tcontainerOptions: containersEnabled ? getContainerOptions(config, this.#containerBuildId) : [],\n\t\t\tworker: {\n\t\t\t\t...options,\n\t\t\t\tname: this.name,\n\t\t\t\tdurableObjects: {\n\t\t\t\t\t...(options.durableObjects as Record<string, unknown> | undefined),\n\t\t\t\t\t// applies hot updates; ephemeral and never evicted so its I/O context lives as long as the modules it evaluates\n\t\t\t\t\t[HMR_RUNNER_CLASS]: { className: HMR_RUNNER_CLASS, unsafeUniqueKey: miniflare.kUnsafeEphemeralUniqueKey, unsafePreventEviction: true },\n\t\t\t\t},\n\t\t\t\tunsafeUseModuleFallbackService: true,\n\t\t\t\tbindings: { ...(options.bindings as Record<string, unknown> | undefined), [HMR_TOKEN_BINDING]: this.#hmrToken },\n\t\t\t\tserviceBindings: { ...(options.serviceBindings as Record<string, unknown> | undefined), ...extraServiceBindings },\n\t\t\t\t// rspack already bundled everything into one module, so module rules have nothing left to match\n\t\t\t\tmodulesRoot: this.#outputDir,\n\t\t\t\tmodules: this.#builtModules,\n\t\t\t\tunsafeInspectorProxy: inspectorEnabled,\n\t\t\t},\n\t\t};\n\t}\n\n\tasync dispose() {\n\t\tawait this.#closeWatcher();\n\t\tawait this.#remoteProxy?.session.dispose();\n\t\tthis.#remoteProxy = null;\n\t}\n}\n","import { Readable } from 'node:stream';\n\nimport type { IncomingMessage, ServerResponse } from 'node:http';\nimport type { TLSSocket } from 'node:tls';\n\nexport function getRequestUrl(req: IncomingMessage) {\n\tconst forwardedProto = req.headers['x-forwarded-proto'];\n\tlet protocol = 'http:';\n\tif (typeof forwardedProto === 'string') {\n\t\tprotocol = `${forwardedProto.split(',', 1)[0]?.trim()}:`;\n\t} else if ((req.socket as TLSSocket).encrypted) {\n\t\tprotocol = 'https:';\n\t}\n\tconst host = req.headers[':authority'] ?? req.headers.host ?? 'localhost';\n\treturn new URL(req.url ?? '/', `${protocol}//${String(host)}`);\n}\n\nexport function getRequestHeaders(req: IncomingMessage) {\n\tconst headers = new Headers();\n\tfor (const [name, value] of Object.entries(req.headers)) {\n\t\t// HTTP/2 pseudo-headers can't be set on a fetch Headers object\n\t\tif (value === undefined || name.startsWith(':')) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (const item of value) {\n\t\t\t\theaders.append(name, item);\n\t\t\t}\n\t\t} else {\n\t\t\theaders.set(name, value);\n\t\t}\n\t}\n\treturn headers;\n}\n\nexport function createRequestInit(req: IncomingMessage, res: ServerResponse) {\n\tconst controller = new AbortController();\n\tres.on('close', () => controller.abort());\n\tconst headers = getRequestHeaders(req);\n\t// responses come back through undici, which decodes compressed bodies but keeps Content-Encoding; asking for identity avoids a mismatch\n\theaders.set('accept-encoding', 'identity');\n\tconst method = req.method ?? 'GET';\n\tconst hasBody = method !== 'GET' && method !== 'HEAD';\n\treturn {\n\t\tmethod,\n\t\t// entries rather than a Headers object, since Miniflare's undici has its own Headers class\n\t\theaders: [...headers],\n\t\tbody: hasBody ? Readable.toWeb(req) as ReadableStream : undefined,\n\t\tduplex: 'half' as const,\n\t\tredirect: 'manual' as const,\n\t\tsignal: controller.signal,\n\t};\n}\n\nfunction escapeHtml(text: string) {\n\treturn text.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;');\n}\n\n/** Responds with the error's (source-mapped) stack, as a page for browsers and plain text for everything else. */\nexport function sendErrorPage(res: ServerResponse, error: unknown) {\n\tif (res.headersSent) {\n\t\tres.destroy();\n\t\treturn;\n\t}\n\tconst message = error instanceof Error ? error.stack ?? error.message : String(error);\n\tif (res.req.headers.accept?.includes('text/html')) {\n\t\tres.writeHead(500, { 'Content-Type': 'text/html; charset=utf-8' });\n\t\tres.end(`<!doctype html><title>Worker error</title><body style=\"font-family:system-ui;margin:2rem\"><h1>Worker error</h1><pre style=\"white-space:pre-wrap\">${escapeHtml(message)}</pre></body>`);\n\t\treturn;\n\t}\n\tres.writeHead(500, { 'Content-Type': 'text/plain; charset=utf-8' });\n\tres.end(message);\n}\n\n/** The parts of a fetch Response we forward, so Miniflare's own undici Response fits as well as the global one. */\ninterface ForwardableResponse {\n\tstatus: number;\n\theaders: Iterable<[string, string]> & { getSetCookie: () => string[]; };\n\tbody: import('node:stream/web').ReadableStream | null;\n}\n\nexport function sendResponse(res: ServerResponse, response: ForwardableResponse) {\n\tconst headers: Record<string, string | string[]> = {};\n\tfor (const [name, value] of response.headers) {\n\t\tif (name === 'set-cookie') {\n\t\t\tcontinue;\n\t\t}\n\t\theaders[name] = value;\n\t}\n\tconst cookies = response.headers.getSetCookie();\n\tif (cookies.length > 0) {\n\t\theaders['set-cookie'] = cookies;\n\t}\n\tres.writeHead(response.status, headers);\n\tif (!response.body || res.req.method === 'HEAD') {\n\t\tres.end();\n\t\treturn;\n\t}\n\tconst body = Readable.fromWeb(response.body);\n\tres.on('close', () => body.destroy());\n\tbody.pipe(res);\n}\n","import net from 'node:net';\n\nexport const DEBUG_PATH = '/__debug';\nconst DEFAULT_INSPECTOR_PORT = 9229;\n\nfunction isPortFree(port: number) {\n\treturn new Promise<boolean>((resolve) => {\n\t\tconst server = net.createServer();\n\t\tserver.once('error', () => resolve(false));\n\t\tserver.listen(port, '127.0.0.1', () => {\n\t\t\tserver.close(() => resolve(true));\n\t\t});\n\t});\n}\n\n/** Resolves the inspector port: the configured one, or 9229 falling back to the next free port like the Vite plugin. */\nexport async function resolveInspectorPort(option: number | false | undefined) {\n\tif (option === false) {\n\t\treturn;\n\t}\n\tif (option !== undefined) {\n\t\treturn option;\n\t}\n\tfor (let port = DEFAULT_INSPECTOR_PORT; port < 65535; port++) {\n\t\tif (await isPortFree(port)) {\n\t\t\treturn port;\n\t\t}\n\t}\n}\n\n/** A page that sends the browser to Cloudflare's hosted DevTools, connected to each Worker through Miniflare's inspector proxy. */\nexport function getDebugPageHtml(workerNames: string[], inspectorPort: number) {\n\tconst urls = workerNames.map((name) => {\n\t\tconst params = new URLSearchParams({ theme: 'systemPreferred', debugger: 'true', ws: `localhost:${inspectorPort}/${name}`, domain: name });\n\t\treturn `https://devtools.devprod.cloudflare.dev/js_app?${params.toString()}`;\n\t});\n\treturn `<!doctype html><script>\nconst [first, ...rest] = ${JSON.stringify(urls)};\nfor (const url of rest) {\n\twindow.open(url);\n}\nwindow.location.replace(first);\n</script>`;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { unstable_convertConfigBindingsToStartWorkerBindings, unstable_printBindings } from 'wrangler';\nimport { WebSocketServer } from 'ws';\n\nimport {\n\tASSET_WORKER_NAME,\n\tDevAssets,\n\tROUTER_WORKER_NAME,\n\tgetAssetConfig,\n\tgetAssetWorkers,\n} from './assets.js';\nimport {\n\tgetContainerEngine,\n\tgetDockerPath,\n\tprepareContainerImages,\n\tremoveContainers,\n} from './containers.js';\nimport { DevWorker } from './dev-worker.js';\nimport {\n\tcreateRequestInit,\n\tgetRequestHeaders,\n\tgetRequestUrl,\n\tsendErrorPage,\n\tsendResponse,\n} from './http.js';\nimport { DEBUG_PATH, getDebugPageHtml, resolveInspectorPort } from './inspector.js';\nimport { miniflare } from './miniflare.js';\n\nimport type { AssetRules, AssetWorkerOptions, ReadableFileSystem } from './assets.js';\nimport type { ResolvedWorker } from './config.js';\nimport type { CloudflarePluginOptions, WorkerConfig } from './options.js';\nimport type { ContainerDevOptions } from '@cloudflare/containers-shared';\nimport type { Compiler } from '@rspack/core';\nimport type { FSWatcher } from 'node:fs';\nimport type { IncomingMessage, Server, ServerResponse } from 'node:http';\nimport type { Duplex } from 'node:stream';\n\ntype Logger = ReturnType<Compiler['getInfrastructureLogger']>;\n\n/** What the session needs from the dev server it runs inside. */\ninterface DevServerHooks {\n\twaitUntilValid: () => Promise<void>;\n\t/** Sends a message to connected HMR clients, which drives the browser's error overlay. */\n\tsendToClients: (type: string, data?: unknown) => void;\n}\n\nconst PLUGIN_NAME = 'rspack-plugin-cloudflare';\n// paths the dev server answers itself, before anything reaches the Workers\nconst DEV_SERVER_PATH_RE = /^\\/(?:webpack-dev-server|__webpack_dev_server__|__open-in-editor|lazy-compilation-using-)/;\n// @rspack/cli turns lazy compilation on for web builds and serves its endpoint after every other middleware\nconst LAZY_COMPILATION_PREFIX = '/_rspack/lazy/trigger';\n// Miniflare's own endpoints, like trigger handlers, which belong to the Worker rather than the asset router\nconst MINIFLARE_PATH_RE = /^\\/(?:cdn-cgi\\/local|__cf_local)\\//;\n// pre-v5 Miniflare paths still in docs and scripts, mapped the same way the Vite plugin does\nconst LEGACY_PATH_REWRITES = [\n\t['/cdn-cgi/handler', '/cdn-cgi/local'],\n\t['/cdn-cgi/mf/scheduled', '/cdn-cgi/local/scheduled'],\n\t['/cdn-cgi/mf/stream', '/__cf_local/stream'],\n\t['/cdn-cgi/mf/imagedelivery', '/__cf_local/imagedelivery'],\n\t['/cdn-cgi/explorer', '/cdn-cgi/local/explorer'],\n] as const;\n// local secrets files that wrangler reads alongside the config\nconst SECRETS_FILE_RE = /^\\.(?:dev\\.vars|env)(?:\\..+)?$/;\n\nfunction rewriteLegacyMiniflarePath(pathname: string) {\n\tfor (const [oldPrefix, newPrefix] of LEGACY_PATH_REWRITES) {\n\t\tif (pathname === oldPrefix || pathname.startsWith(`${oldPrefix}/`)) {\n\t\t\treturn newPrefix + pathname.slice(oldPrefix.length);\n\t\t}\n\t}\n\treturn pathname;\n}\n\n// read per request, since @rspack/cli only enables lazy compilation once the dev server starts\nfunction getLazyCompilationPrefix(compiler: Compiler) {\n\tconst { lazyCompilation } = compiler.options;\n\tif (typeof lazyCompilation === 'object' && lazyCompilation.prefix) {\n\t\treturn lazyCompilation.prefix;\n\t}\n\treturn LAZY_COMPILATION_PREFIX;\n}\n\n/** Runs the entry Worker and any auxiliary Workers in one Miniflare, routing dev server requests like Cloudflare does. */\nexport class DevSession {\n\t/** Reads every Worker's config before the session starts, since `cloudflare.config.ts` can only be loaded asynchronously. */\n\tstatic async create(options: { compiler: Compiler; resolvers: (() => Promise<ResolvedWorker>)[]; pluginOptions: CloudflarePluginOptions; logger: Logger; }) {\n\t\tconst workers = await Promise.all(options.resolvers.map(async (resolve) => {\n\t\t\treturn { resolve, resolved: await resolve() };\n\t\t}));\n\t\treturn new DevSession({ ...options, workers });\n\t}\n\n\treadonly #compiler: Compiler;\n\treadonly #options: CloudflarePluginOptions;\n\treadonly #logger: Logger;\n\treadonly #workers: DevWorker[];\n\treadonly #entry: DevWorker;\n\t#hooks: DevServerHooks | undefined;\n\t#assets: DevAssets | undefined;\n\t#miniflare: InstanceType<typeof miniflare.Miniflare> | undefined;\n\t#inspectorPort: number | undefined;\n\treadonly #configWatchers = new Map<string, FSWatcher>();\n\treadonly #pendingReloads = new Map<DevWorker, ReturnType<typeof setTimeout>>();\n\t// images already built this session, which are also the ones whose containers need removing on exit\n\treadonly #containerTags = new Set<string>();\n\treadonly #removeContainersOnExit = () => removeContainers(getDockerPath(), this.#containerTags);\n\t// Workers rebuilt since Miniflare last picked up their code, and those whose build is failing\n\treadonly #updated = new Set<DevWorker>();\n\treadonly #failing = new Set<DevWorker>();\n\t// builds finish independently, so loading them into Miniflare happens strictly one at a time\n\t#loading = Promise.resolve();\n\t// open while any Worker is building, so requests wait for the code they'd otherwise miss\n\t#gate: { promise: Promise<void>; release: () => void; } | undefined;\n\t// the `_headers` and `_redirects` Miniflare last started the asset Worker with\n\t#assetRules: AssetRules | undefined;\n\n\tprivate constructor(options: { compiler: Compiler; workers: { resolved: ResolvedWorker; resolve: () => Promise<ResolvedWorker>; }[]; pluginOptions: CloudflarePluginOptions; logger: Logger; }) {\n\t\tthis.#compiler = options.compiler;\n\t\tthis.#options = options.pluginOptions;\n\t\tthis.#logger = options.logger;\n\t\tthis.#workers = options.workers.map(({ resolved, resolve }) => new DevWorker({\n\t\t\tcompiler: options.compiler,\n\t\t\tresolved,\n\t\t\tresolve,\n\t\t\tpluginOptions: options.pluginOptions,\n\t\t\tlogger: options.logger,\n\t\t\tevents: {\n\t\t\t\tonBuildStart: () => this.#openGate(),\n\t\t\t\tonBuildDone: (worker) => {\n\t\t\t\t\tthis.#loading = this.#loading.then(() => this.#onBuildDone(worker));\n\t\t\t\t\treturn this.#loading;\n\t\t\t\t},\n\t\t\t},\n\t\t}));\n\t\tconst [entry] = this.#workers;\n\t\tif (!entry) {\n\t\t\tthrow new Error('A dev session needs at least one Worker.');\n\t\t}\n\t\tthis.#entry = entry;\n\t\tthis.#openGate();\n\t}\n\n\t#openGate() {\n\t\tif (this.#gate) {\n\t\t\treturn;\n\t\t}\n\t\tconst { promise, resolve } = Promise.withResolvers<void>();\n\t\tthis.#gate = { promise, release: resolve };\n\t}\n\n\t#releaseGateIfIdle() {\n\t\tif (this.#gate && this.#workers.every(worker => !worker.building)) {\n\t\t\tthis.#gate.release();\n\t\t\tthis.#gate = undefined;\n\t\t}\n\t}\n\n\tasync #ready() {\n\t\twhile (this.#gate) {\n\t\t\tawait this.#gate.promise;\n\t\t}\n\t\treturn this.#miniflare;\n\t}\n\n\tasync #onBuildDone(worker: DevWorker) {\n\t\tif (worker.buildError) {\n\t\t\tthis.#failing.add(worker);\n\t\t\tthis.#logger.error(`Worker \"${worker.name}\" build failed${this.#miniflare ? '; still serving the previous build' : ''}:\\n${worker.buildError}`);\n\t\t\tthis.#hooks?.sendToClients('errors', [{ moduleName: `Worker \"${worker.name}\"`, message: worker.buildError }]);\n\t\t} else {\n\t\t\tthis.#updated.add(worker);\n\t\t\tif (this.#failing.delete(worker) && this.#failing.size === 0) {\n\t\t\t\t// dismisses the overlay without reloading the page\n\t\t\t\tthis.#hooks?.sendToClients('still-ok');\n\t\t\t}\n\t\t}\n\t\t// the last Worker to finish loads everyone's changes together\n\t\tif (this.#workers.some(other => other.building)) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tawait this.#load();\n\t\t} catch (error) {\n\t\t\tthis.#logger.error(`Workers failed to start:\\n${String(error)}`);\n\t\t}\n\t\tthis.#releaseGateIfIdle();\n\t}\n\n\t/** Gets new builds running: hot updates when possible, otherwise a restart of every Worker. */\n\tasync #load() {\n\t\tif (!this.#miniflare) {\n\t\t\tif (this.#failing.size > 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#miniflare = new miniflare.Miniflare(await this.#getMiniflareOptions());\n\t\t\tawait this.#miniflare.ready;\n\t\t\tthis.#printReady();\n\t\t\tthis.#markLoaded();\n\t\t\treturn;\n\t\t}\n\n\t\tconst restart = this.#workers.find(worker => worker.restartReason);\n\t\tif (restart) {\n\t\t\tawait this.#restart(`Worker \"${restart.name}\" restarted: ${restart.restartReason ?? ''}`);\n\t\t\treturn;\n\t\t}\n\t\tfor (const worker of this.#updated) {\n\t\t\tconst result = await worker.applyHotUpdate(this.#miniflare);\n\t\t\tif (result.reload) {\n\t\t\t\tawait this.#restart(`Worker \"${worker.name}\" restarted: ${result.reason ?? 'the update could not be applied in place'}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#logger.info(`Worker \"${worker.name}\" hot updated`);\n\t\t}\n\t\tthis.#updated.clear();\n\t}\n\n\tasync #restart(message: string) {\n\t\tawait this.#miniflare?.setOptions(await this.#getMiniflareOptions());\n\t\tthis.#logger.info(message);\n\t\tthis.#markLoaded();\n\t}\n\n\t#markLoaded() {\n\t\tfor (const worker of this.#workers) {\n\t\t\tworker.markLoaded();\n\t\t}\n\t\tthis.#updated.clear();\n\t}\n\n\t#printReady() {\n\t\tfor (const worker of this.#workers) {\n\t\t\tconst { config, name } = worker.resolved;\n\t\t\tunstable_printBindings(unstable_convertConfigBindingsToStartWorkerBindings(config), {\n\t\t\t\tname,\n\t\t\t\tlocal: true,\n\t\t\t\twarnIfNoBindings: false,\n\t\t\t\tisMultiWorker: this.#workers.length > 1,\n\t\t\t\tcontainers: config.containers,\n\t\t\t\ttailConsumers: config.tail_consumers,\n\t\t\t\tstreamingTailConsumers: config.streaming_tail_consumers,\n\t\t\t\tlog: (message: string) => this.#logger.info(message),\n\t\t\t});\n\t\t}\n\t\tconst names = this.#workers.map(worker => `\"${worker.name}\"`).join(', ');\n\t\tconst debug = this.#inspectorPort === undefined ? '' : `; debug at ${DEBUG_PATH} (inspector on port ${this.#inspectorPort})`;\n\t\tthis.#logger.info(`${this.#workers.length > 1 ? 'Workers' : 'Worker'} ${names} ready${debug}`);\n\t}\n\n\t/** Serves rspack's hot-update modules, which workerd imports through Miniflare's module fallback as `/<worker>/<file>`. */\n\tasync #serveHotUpdate(request: Parameters<typeof miniflare.parseModuleFallbackRequest>[0]) {\n\t\tconst parsed = await miniflare.parseModuleFallbackRequest(request);\n\t\tconst [, workerName = '', ...rest] = (parsed?.specifier ?? '').split('/');\n\t\tconst worker = this.#workers.find(candidate => candidate.name === workerName);\n\t\tconst source = await worker?.readHotUpdate(rest.join('/'));\n\t\tif (source === undefined) {\n\t\t\treturn new miniflare.Response(null, { status: 404 });\n\t\t}\n\t\treturn miniflare.Response.json({ esModule: source });\n\t}\n\n\t#assetsServiceBinding(): Record<string, unknown> {\n\t\tconst binding = this.#entry.resolved.assets?.binding;\n\t\tif (!binding || !this.#assets) {\n\t\t\treturn {};\n\t\t}\n\t\treturn { [binding]: ASSET_WORKER_NAME };\n\t}\n\n\t/** Builds images not seen yet this session, returning the engine Miniflare should start containers with. */\n\tasync #prepareContainers(workers: { config: WorkerConfig; containerOptions: ContainerDevOptions[]; }[]) {\n\t\tconst withContainers = workers.filter(worker => worker.containerOptions.length > 0);\n\t\tconst [first] = withContainers;\n\t\tif (!first) {\n\t\t\treturn;\n\t\t}\n\t\tconst dockerPath = getDockerPath();\n\t\tconst pending = withContainers.map(({ config, containerOptions }) => {\n\t\t\treturn { config, containerOptions: containerOptions.filter(options => !this.#containerTags.has(options.image_tag)) };\n\t\t});\n\t\tif (pending.some(worker => worker.containerOptions.length > 0)) {\n\t\t\tthis.#logger.info('Building container images for local development...');\n\t\t\tfor (const { config, containerOptions } of pending) {\n\t\t\t\tawait prepareContainerImages({ config, dockerPath, containerOptions, logger: this.#logger });\n\t\t\t\tfor (const options of containerOptions) {\n\t\t\t\t\tthis.#containerTags.add(options.image_tag);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// rspack serve may exit without a shutdown hook, like on a crash, and containers would keep running\n\t\t\tprocess.off('exit', this.#removeContainersOnExit);\n\t\t\tprocess.on('exit', this.#removeContainersOnExit);\n\t\t\tthis.#logger.info('Container images built; restart dev to rebuild them after changing a Dockerfile.');\n\t\t}\n\t\treturn getContainerEngine(first.config, dockerPath);\n\t}\n\n\tasync #getAssetWorkers(assetWorkerOptions: AssetWorkerOptions | undefined) {\n\t\tconst assets = this.#assets;\n\t\tif (!assetWorkerOptions || !assets) {\n\t\t\treturn [];\n\t\t}\n\t\tthis.#assetRules = await assets.readRules();\n\t\treturn getAssetWorkers({\n\t\t\trouterConfig: assetWorkerOptions.routerConfig,\n\t\t\tassetConfig: getAssetConfig(assetWorkerOptions, this.#assetRules, this.#logger),\n\t\t\tuserWorkerName: this.#entry.resolved.main ? this.#entry.name : undefined,\n\t\t\tassets,\n\t\t});\n\t}\n\n\t/** Restarts the Workers when the build's `_headers` or `_redirects` change, since the asset Worker reads them at startup. */\n\tasync #checkAssetRules() {\n\t\tconst previous = this.#assetRules;\n\t\tif (!this.#miniflare || !this.#assets || !previous) {\n\t\t\treturn;\n\t\t}\n\t\tconst current = await this.#assets.readRules();\n\t\tif (current.headers !== previous.headers || current.redirects !== previous.redirects) {\n\t\t\tawait this.#restart('Workers restarted: _headers or _redirects changed');\n\t\t}\n\t}\n\n\tasync #getMiniflareOptions() {\n\t\tconst workers: unknown[] = [];\n\t\tconst externalWorkers: unknown[] = [];\n\t\tconst containers: { config: WorkerConfig; containerOptions: ContainerDevOptions[]; }[] = [];\n\t\tlet assetWorkerOptions: AssetWorkerOptions | undefined;\n\t\tfor (const worker of this.#workers) {\n\t\t\tconst extraBindings = worker === this.#entry ? this.#assetsServiceBinding() : {};\n\t\t\tconst options = await worker.getMiniflareOptions(extraBindings, this.#inspectorPort !== undefined);\n\t\t\tif (worker === this.#entry) {\n\t\t\t\tassetWorkerOptions = options.assetWorkerOptions;\n\t\t\t}\n\t\t\tif (!worker.resolved.main) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tworkers.push(options.worker);\n\t\t\texternalWorkers.push(...options.externalWorkers);\n\t\t\tcontainers.push({ config: worker.resolved.config, containerOptions: options.containerOptions });\n\t\t}\n\t\tconst containerEngine = await this.#prepareContainers(containers);\n\t\tconst assetWorkers = await this.#getAssetWorkers(assetWorkerOptions);\n\n\t\tconst { rootDir } = this.#entry.resolved;\n\t\tconst { persistState = true } = this.#options;\n\t\tlet resourcePersistencePath: string | undefined;\n\t\tif (persistState !== false) {\n\t\t\tconst statePath = typeof persistState === 'object' ? persistState.path : path.join('.wrangler', 'state');\n\t\t\tresourcePersistencePath = path.resolve(rootDir, statePath, 'v3');\n\t\t}\n\n\t\treturn miniflare.convertV4MiniflareOptions({\n\t\t\tlog: new miniflare.Log(miniflare.LogLevel.INFO),\n\t\t\tinspectorPort: this.#inspectorPort,\n\t\t\tresourcePersistencePath,\n\t\t\tresourceTmpPath: path.join(rootDir, '.wrangler', 'tmp'),\n\t\t\tcontainerEngine,\n\t\t\t// lets service bindings reach Workers running in other local dev sessions, and theirs reach these\n\t\t\tunsafeDevRegistryPath: miniflare.getDefaultDevRegistryPath(),\n\t\t\t// serves /cdn-cgi/local/scheduled and friends for testing non-fetch handlers\n\t\t\tunsafeTriggerHandlers: true,\n\t\t\tunsafeModuleFallbackService: (request: Parameters<typeof miniflare.parseModuleFallbackRequest>[0]) => this.#serveHotUpdate(request),\n\t\t\t// the first Worker gets requests without a route override: the entry Worker, or the router for an assets-only project\n\t\t\tworkers: [...workers, ...assetWorkers, ...externalWorkers],\n\t\t} as Parameters<typeof miniflare.convertV4MiniflareOptions>[0]);\n\t}\n\n\t#createDevAssets() {\n\t\tconst { assets } = this.#entry.resolved;\n\t\tconst hooks = this.#hooks;\n\t\tif (!assets || !hooks) {\n\t\t\treturn;\n\t\t}\n\t\treturn new DevAssets({\n\t\t\tdirectory: assets.directory,\n\t\t\t// assets imported by Worker code, which `rspack build` copies into the assets directory\n\t\t\textraDirectories: [this.#entry.importedAssetsDir],\n\t\t\t// the dev server replaces the client compiler's output filesystem with an in-memory one\n\t\t\tgetOutputFileSystem: () => this.#compiler.outputFileSystem as ReadableFileSystem | null ?? undefined,\n\t\t\twaitUntilValid: hooks.waitUntilValid,\n\t\t});\n\t}\n\n\t/** Rebuilds a Worker when its config, a file its config imports, or its local secrets change, like the Vite plugin restarting its server. */\n\t#watchConfigs() {\n\t\tfor (const worker of this.#workers) {\n\t\t\tconst { configFiles, rootDir } = worker.resolved;\n\t\t\tfor (const directory of [rootDir, ...configFiles.map(file => path.dirname(file))]) {\n\t\t\t\tif (!this.#configWatchers.has(directory)) {\n\t\t\t\t\tthis.#configWatchers.set(directory, fs.watch(directory, (_event, fileName) => this.#onConfigDirectoryChange(directory, fileName)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t#onConfigDirectoryChange(directory: string, fileName: string | null) {\n\t\tif (!fileName) {\n\t\t\treturn;\n\t\t}\n\t\tconst filePath = path.join(directory, fileName);\n\t\tfor (const worker of this.#workers) {\n\t\t\tconst { configFiles, rootDir } = worker.resolved;\n\t\t\tif (configFiles.includes(filePath) || (rootDir === directory && SECRETS_FILE_RE.test(fileName))) {\n\t\t\t\tthis.#scheduleReload(worker);\n\t\t\t}\n\t\t}\n\t}\n\n\t#scheduleReload(worker: DevWorker) {\n\t\tclearTimeout(this.#pendingReloads.get(worker));\n\t\t// editors often write a file in several steps, so wait for them to settle\n\t\tthis.#pendingReloads.set(worker, setTimeout(() => {\n\t\t\tthis.#pendingReloads.delete(worker);\n\t\t\tthis.#reloadWorker(worker).catch((error: unknown) => {\n\t\t\t\tthis.#logger.error(`Worker \"${worker.name}\" failed to reload its config:\\n${String(error)}`);\n\t\t\t});\n\t\t}, 100));\n\t}\n\n\tasync #reloadWorker(worker: DevWorker) {\n\t\tthis.#logger.info(`Worker \"${worker.name}\" config changed; rebuilding`);\n\t\tthis.#openGate();\n\t\ttry {\n\t\t\tawait worker.reload();\n\t\t\tif (worker === this.#entry) {\n\t\t\t\tthis.#assets = this.#createDevAssets();\n\t\t\t}\n\t\t} finally {\n\t\t\t// a config that fails to load keeps the previous build serving, so requests can't be left waiting for a rebuild\n\t\t\tthis.#releaseGateIfIdle();\n\t\t}\n\t\t// the new config can import files from directories nobody is watching yet\n\t\tthis.#watchConfigs();\n\t}\n\n\tasync #upgrade(webSocketServer: WebSocketServer, url: URL, req: IncomingMessage, socket: Duplex, head: Buffer) {\n\t\tconst mf = await this.#ready();\n\t\tif (!mf) {\n\t\t\tsocket.destroy();\n\t\t\treturn;\n\t\t}\n\t\tconst response = await mf.dispatchFetch(url, { method: req.method, headers: [...getRequestHeaders(req)] });\n\t\tconst workerSocket = response.webSocket;\n\t\tif (!workerSocket || socket.destroyed) {\n\t\t\tsocket.destroy();\n\t\t\treturn;\n\t\t}\n\t\twebSocketServer.handleUpgrade(req, socket, head, (clientSocket) => {\n\t\t\tminiflare.coupleWebSocket(clientSocket, workerSocket).catch((error: unknown) => {\n\t\t\t\tthis.#logger.error(`WebSocket to the Worker failed: ${String(error)}`);\n\t\t\t\tclientSocket.terminate();\n\t\t\t});\n\t\t});\n\t}\n\n\t#sendError(res: ServerResponse, error: unknown) {\n\t\tthis.#logger.error(error instanceof Error ? error.stack ?? error.message : String(error));\n\t\tsendErrorPage(res, error);\n\t}\n\n\tasync #start() {\n\t\tthis.#inspectorPort = await resolveInspectorPort(this.#options.inspectorPort);\n\t\tfor (const worker of this.#workers) {\n\t\t\tworker.start();\n\t\t}\n\t\tthis.#watchConfigs();\n\t\tif (this.#workers.every(worker => !worker.building)) {\n\t\t\t// an assets-only project has nothing to build, so the router and asset Workers can start straight away\n\t\t\tthis.#loading = this.#loading.then(() => this.#load());\n\t\t\tawait this.#loading;\n\t\t}\n\t\tthis.#releaseGateIfIdle();\n\t}\n\n\tstart(hooks: DevServerHooks) {\n\t\tthis.#hooks = hooks;\n\t\tthis.#assets = this.#createDevAssets();\n\t\tthis.#compiler.hooks.done.tap(PLUGIN_NAME, () => {\n\t\t\tthis.#loading = this.#loading.then(() => this.#checkAssetRules()).catch((error: unknown) => {\n\t\t\t\tthis.#logger.error(`Workers failed to pick up _headers or _redirects:\\n${String(error)}`);\n\t\t\t});\n\t\t});\n\t\tthis.#start().catch((error: unknown) => {\n\t\t\tthis.#logger.error(`Workers failed to start:\\n${String(error)}`);\n\t\t\tthis.#gate?.release();\n\t\t});\n\t}\n\n\t/** Connect middleware that sends each request through Cloudflare's router Worker, or straight to the Worker without assets. */\n\tasync handle(req: IncomingMessage, res: ServerResponse, next: () => void) {\n\t\tconst url = getRequestUrl(req);\n\t\tif (DEV_SERVER_PATH_RE.test(url.pathname) || url.pathname.startsWith(getLazyCompilationPrefix(this.#compiler))) {\n\t\t\tnext();\n\t\t\treturn;\n\t\t}\n\t\tif (url.pathname === DEBUG_PATH && this.#inspectorPort !== undefined) {\n\t\t\tres.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });\n\t\t\tres.end(getDebugPageHtml(this.#workers.map(worker => worker.name), this.#inspectorPort));\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\turl.pathname = rewriteLegacyMiniflarePath(url.pathname);\n\t\t\tconst mf = await this.#ready();\n\t\t\tif (!mf) {\n\t\t\t\t// already logged when the build failed, so only the browser needs telling\n\t\t\t\tconst errors = [...this.#failing].map(worker => `Worker \"${worker.name}\":\\n${worker.buildError ?? ''}`);\n\t\t\t\tsendErrorPage(res, `Workers failed to start:\\n${errors.join('\\n\\n')}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst init = createRequestInit(req, res);\n\t\t\tif (this.#assets && !MINIFLARE_PATH_RE.test(url.pathname)) {\n\t\t\t\tinit.headers.push([miniflare.CoreHeaders.ROUTE_OVERRIDE, ROUTER_WORKER_NAME]);\n\t\t\t}\n\t\t\tconst response = await mf.dispatchFetch(url, init);\n\t\t\tsendResponse(res, response);\n\t\t} catch (error) {\n\t\t\tthis.#sendError(res, error);\n\t\t}\n\t}\n\n\t/** Forwards WebSocket upgrades to the Worker, leaving the dev server's own HMR socket alone. */\n\tattachUpgradeHandler(server: Server, devServerSocketPath: string) {\n\t\tif (!this.#entry.resolved.main) {\n\t\t\treturn;\n\t\t}\n\t\tconst webSocketServer = new WebSocketServer({ noServer: true });\n\t\tserver.on('upgrade', (req: IncomingMessage, socket: Duplex, head: Buffer) => {\n\t\t\tconst url = getRequestUrl(req);\n\t\t\tif (url.pathname === devServerSocketPath) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsocket.on('error', () => socket.destroy());\n\t\t\tthis.#upgrade(webSocketServer, url, req, socket, head).catch((error: unknown) => {\n\t\t\t\tthis.#logger.error(`WebSocket upgrade to the Worker failed: ${String(error)}`);\n\t\t\t\tsocket.destroy();\n\t\t\t});\n\t\t});\n\t}\n\n\t/** The entry Worker as its config was last read. */\n\tget entry() {\n\t\treturn this.#entry.resolved;\n\t}\n\n\tasync dispose() {\n\t\tfor (const watcher of this.#configWatchers.values()) {\n\t\t\twatcher.close();\n\t\t}\n\t\tfor (const timeout of this.#pendingReloads.values()) {\n\t\t\tclearTimeout(timeout);\n\t\t}\n\t\tawait Promise.all(this.#workers.map(worker => worker.dispose()));\n\t\tawait this.#miniflare?.dispose();\n\t\tthis.#miniflare = undefined;\n\t\tthis.#removeContainersOnExit();\n\t\tprocess.off('exit', this.#removeContainersOnExit);\n\t}\n}\n","import { spawn } from 'node:child_process';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\n\nimport { unstable_resolveNamedTunnel } from 'wrangler';\n\nimport type { TunnelOptions, WorkerConfig } from './options.js';\nimport type { ChildProcess } from 'node:child_process';\n\nconst QUICK_TUNNEL_URL_RE = /https:\\/\\/[\\da-z-]+\\.trycloudflare\\.com/;\n// cloudflared logs this once the edge accepts the tunnel, which is when the public URL starts working\nconst CONNECTED_RE = /Registered tunnel connection/;\nconst STARTUP_TIMEOUT_MS = 30000;\n\nexport interface Tunnel {\n\turls: string[];\n\tclose: () => void;\n}\n\nfunction getWranglerBin() {\n\tconst require = createRequire(import.meta.url);\n\treturn path.join(path.dirname(require.resolve('wrangler/package.json')), 'bin', 'wrangler.js');\n}\n\nfunction stopProcessTree(child: ChildProcess) {\n\tif (child.exitCode !== null || child.pid === undefined) {\n\t\treturn;\n\t}\n\tif (process.platform === 'win32') {\n\t\t// Windows has no SIGTERM for wrangler to forward, so cloudflared would outlive it without killing the whole tree\n\t\tspawn('taskkill', ['/pid', String(child.pid), '/t', '/f'], { stdio: 'ignore' });\n\t} else {\n\t\tchild.kill('SIGTERM');\n\t}\n}\n\nfunction waitUntilConnected(child: ChildProcess, isNamed: boolean) {\n\treturn new Promise<string | undefined>((resolve, reject) => {\n\t\tlet output = '';\n\t\tlet quickUrl: string | undefined;\n\t\tlet settled = false;\n\t\tfunction fail(error: Error) {\n\t\t\tif (!settled) {\n\t\t\t\tsettled = true;\n\t\t\t\tstopProcessTree(child);\n\t\t\t\treject(error);\n\t\t\t}\n\t\t}\n\t\tfunction onData(data: Buffer) {\n\t\t\t// only kept for the error message, so a long-running tunnel doesn't keep growing it\n\t\t\tif (output.length < 20000) {\n\t\t\t\toutput += String(data);\n\t\t\t}\n\t\t\tquickUrl ??= QUICK_TUNNEL_URL_RE.exec(output)?.[0];\n\t\t\tif (!settled && CONNECTED_RE.test(output) && (isNamed || quickUrl)) {\n\t\t\t\tsettled = true;\n\t\t\t\tresolve(quickUrl);\n\t\t\t}\n\t\t}\n\t\tAbortSignal.timeout(STARTUP_TIMEOUT_MS).addEventListener('abort', () => {\n\t\t\tfail(new Error(`The tunnel didn't connect within ${STARTUP_TIMEOUT_MS / 1000}s:\\n${output}`));\n\t\t});\n\t\tchild.stdout?.on('data', onData);\n\t\tchild.stderr?.on('data', onData);\n\t\tchild.once('error', fail);\n\t\tchild.once('exit', (code) => {\n\t\t\tfail(new Error(`wrangler tunnel exited with code ${String(code)}:\\n${output}`));\n\t\t});\n\t});\n}\n\n/**\n * Shares the dev server through a Cloudflare Tunnel: a Quick Tunnel on a random trycloudflare.com URL, or a named\n * tunnel whose routes point at the dev server. wrangler runs it, so it downloads and updates cloudflared as needed.\n */\nexport async function startTunnel(options: { origin: URL; tunnel: TunnelOptions; config: WorkerConfig; cwd: string; }): Promise<Tunnel> {\n\tconst { origin, tunnel, config } = options;\n\tconst args = ['tunnel'];\n\tconst env: NodeJS.ProcessEnv = { ...process.env };\n\tlet urls: string[] = [];\n\tif (tunnel.name === undefined) {\n\t\targs.push('quick-start', origin.href, ...(tunnel.allowedMail ?? []).flatMap(mail => ['--allowed-mail', mail]));\n\t\tif (origin.protocol === 'https:') {\n\t\t\t// the dev server's certificate is for the developer's own hostname, never the loopback address cloudflared dials\n\t\t\tenv.NO_TLS_VERIFY = 'true';\n\t\t}\n\t} else {\n\t\tif (tunnel.allowedMail?.length) {\n\t\t\tthrow new Error('`tunnel.allowedMail` only works with Quick Tunnels; protect a named tunnel with Cloudflare Access instead.');\n\t\t}\n\t\t// also checks the tunnel has a route to this dev server, which is the usual setup mistake\n\t\tconst { hostnames } = await unstable_resolveNamedTunnel(tunnel.name, origin, {\n\t\t\taccountId: config.account_id,\n\t\t\tcomplianceRegion: config.compliance_region,\n\t\t});\n\t\turls = hostnames.map(hostname => `https://${hostname}`);\n\t\targs.push('run', tunnel.name);\n\t}\n\n\tconst child = spawn(process.execPath, [getWranglerBin(), ...args], { cwd: options.cwd, env, stdio: ['ignore', 'pipe', 'pipe'] });\n\tconst quickUrl = await waitUntilConnected(child, tunnel.name !== undefined);\n\tif (quickUrl) {\n\t\turls = [quickUrl];\n\t}\n\treturn { urls, close: () => stopProcessTree(child) };\n}\n","import { buildWorkers, copyImportedAssets } from './build.js';\nimport { getWorkerResolvers } from './config.js';\nimport { DevSession } from './dev.js';\nimport { startTunnel } from './tunnel.js';\n\nimport type { ResolvedWorker } from './config.js';\nimport type { CloudflarePluginOptions } from './options.js';\nimport type { Tunnel } from './tunnel.js';\nimport type { Compiler, RspackPluginInstance } from '@rspack/core';\nimport type { RspackDevServer } from '@rspack/dev-server';\nimport type { IncomingMessage, Server, ServerResponse } from 'node:http';\n\nexport type {\n\tAuxiliaryWorkerOptions,\n\tCloudflarePluginOptions,\n\tTunnelOptions,\n\tWorkerConfig,\n\tWorkerConfigCustomizer,\n} from './options.js';\n\nconst PLUGIN_NAME = 'rspack-plugin-cloudflare';\n\n// listen addresses a tunnel can't dial by name, so it reaches the dev server through localhost instead\nconst WILDCARD_HOSTS = new Set(['0.0.0.0', '::', 'local-ip', 'local-ipv4', 'local-ipv6']);\n\nfunction getDevServerOrigin(server: RspackDevServer) {\n\tconst address = server.server?.address();\n\tconst port = typeof address === 'object' && address ? address.port : Number(server.options.port);\n\tconst serverOption = server.options.server;\n\tconst serverType = typeof serverOption === 'object' ? serverOption.type : serverOption;\n\tconst protocol = serverType === undefined || serverType === 'http' ? 'http' : 'https';\n\tconst { host } = server.options;\n\tconst hostname = !host || WILDCARD_HOSTS.has(host) ? 'localhost' : host;\n\treturn new URL(`${protocol}://${hostname}:${port}`);\n}\n\n/** Lets the tunnel's hostnames past the dev server's Host header check. */\nfunction allowHosts(server: RspackDevServer, urls: string[]) {\n\tconst { allowedHosts } = server.options;\n\tif (allowedHosts === 'all') {\n\t\treturn;\n\t}\n\tconst hostnames = urls.map(url => new URL(url).hostname);\n\t// a list keeps what 'auto' allowed, since localhost, IPs and the configured host always pass\n\tif (Array.isArray(allowedHosts)) {\n\t\tserver.options.allowedHosts = [...allowedHosts, ...hostnames];\n\t} else if (allowedHosts && allowedHosts !== 'auto') {\n\t\tserver.options.allowedHosts = [allowedHosts, ...hostnames];\n\t} else {\n\t\tserver.options.allowedHosts = hostnames;\n\t}\n}\n\nfunction getSocketPath(server: RspackDevServer) {\n\tconst socketOptions = server.options.webSocketServer;\n\tif (typeof socketOptions === 'object' && socketOptions && typeof socketOptions.options?.path === 'string') {\n\t\treturn socketOptions.options.path;\n\t}\n\treturn '/ws';\n}\n\nexport class CloudflarePlugin implements RspackPluginInstance {\n\t#tunnel: Tunnel | undefined;\n\treadonly options: CloudflarePluginOptions;\n\n\tconstructor(options: CloudflarePluginOptions = {}) {\n\t\tthis.options = options;\n\t}\n\n\tasync #openTunnel(server: RspackDevServer, session: Promise<DevSession> | undefined, logger: ReturnType<Compiler['getInfrastructureLogger']>) {\n\t\tconst { tunnel: tunnelOption } = this.options;\n\t\tif (!session || !tunnelOption) {\n\t\t\treturn;\n\t\t}\n\t\tconst { entry } = await session;\n\t\tlogger.warn('Starting a Cloudflare Tunnel: anyone with its URL can reach this dev server and its Worker\\'s local bindings.');\n\t\tthis.#tunnel = await startTunnel({\n\t\t\torigin: getDevServerOrigin(server),\n\t\t\ttunnel: tunnelOption === true ? {} : tunnelOption,\n\t\t\tconfig: entry.config,\n\t\t\tcwd: entry.rootDir,\n\t\t});\n\t\tallowHosts(server, this.#tunnel.urls);\n\t\tfor (const url of this.#tunnel.urls) {\n\t\t\tlogger.info(`Tunnel: ${url}`);\n\t\t}\n\t}\n\n\tapply(compiler: Compiler) {\n\t\ttype DevServerOptions = NonNullable<RspackDevServer['options']>;\n\t\tconst logger = compiler.getInfrastructureLogger(PLUGIN_NAME);\n\t\tconst resolvers = getWorkerResolvers(compiler.context, this.options, compiler.options.output.path);\n\t\tlet session: Promise<DevSession> | undefined;\n\n\t\t// `rspack serve` builds the dev server from these options after plugins apply, so wrapping them here hooks us in\n\t\tconst devServer = compiler.options.devServer as DevServerOptions | undefined;\n\t\tif (devServer) {\n\t\t\ttype Middlewares = Parameters<NonNullable<DevServerOptions['setupMiddlewares']>>[0];\n\t\t\tconst { setupMiddlewares, onListening } = devServer;\n\t\t\tdevServer.setupMiddlewares = (middlewares: Middlewares, server: RspackDevServer) => {\n\t\t\t\tconst result = setupMiddlewares ? setupMiddlewares(middlewares, server) : middlewares;\n\t\t\t\tconst activeSession = DevSession.create({ compiler, resolvers, pluginOptions: this.options, logger }).then((created) => {\n\t\t\t\t\tcreated.start({\n\t\t\t\t\t\twaitUntilValid: () => new Promise((resolve) => {\n\t\t\t\t\t\t\tif (server.middleware) {\n\t\t\t\t\t\t\t\tserver.middleware.waitUntilValid(() => resolve());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tsendToClients: (type, data) => {\n\t\t\t\t\t\t\tif (server.webSocketServer) {\n\t\t\t\t\t\t\t\tserver.sendMessage(server.webSocketServer.clients, type, data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\treturn created;\n\t\t\t\t});\n\t\t\t\tactiveSession.catch((error: unknown) => {\n\t\t\t\t\tlogger.error(`Workers failed to start:\\n${String(error)}`);\n\t\t\t\t});\n\t\t\t\tsession = activeSession;\n\t\t\t\t// ahead of dev-middleware so `run_worker_first` decides who answers, not whatever the client build emitted\n\t\t\t\tconst devMiddlewareIndex = result.findIndex(middleware => typeof middleware === 'object' && middleware.name === '@rspack/dev-middleware');\n\t\t\t\tresult.splice(devMiddlewareIndex === -1 ? result.length : devMiddlewareIndex, 0, {\n\t\t\t\t\tname: PLUGIN_NAME,\n\t\t\t\t\tmiddleware: (req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => void) => {\n\t\t\t\t\t\tactiveSession.then(created => created.handle(req, res, next)).catch(next);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\treturn result;\n\t\t\t};\n\t\t\tdevServer.onListening = (server: RspackDevServer) => {\n\t\t\t\tconst httpServer = server.server;\n\t\t\t\tif (session && httpServer) {\n\t\t\t\t\t// a session that failed to start has already been logged, and leaves nothing to forward upgrades to\n\t\t\t\t\tsession.then(created => created.attachUpgradeHandler(httpServer as Server, getSocketPath(server))).catch(() => {});\n\t\t\t\t}\n\t\t\t\tif (this.options.tunnel) {\n\t\t\t\t\tthis.#openTunnel(server, session, logger).catch((error: unknown) => {\n\t\t\t\t\t\tlogger.error(`Tunnel failed to start: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tonListening?.(server);\n\t\t\t};\n\t\t}\n\n\t\t// the Workers `rspack build` bundled, whose imported assets join the client output once it has emitted\n\t\tlet builtWorkers: ResolvedWorker[] | undefined;\n\t\tcompiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, async () => {\n\t\t\tconst workers = await Promise.all(resolvers.map(resolve => resolve()));\n\t\t\tawait buildWorkers({ compiler, workers, pluginOptions: this.options });\n\t\t\tfor (const worker of workers) {\n\t\t\t\tlogger.info(`Built ${worker.main ? 'Worker' : 'assets-only config'} \"${worker.name}\" into ${worker.outputDir}`);\n\t\t\t}\n\t\t\tbuiltWorkers = workers;\n\t\t});\n\t\tcompiler.hooks.afterEmit.tapPromise(PLUGIN_NAME, async () => {\n\t\t\tif (builtWorkers) {\n\t\t\t\tawait copyImportedAssets(builtWorkers);\n\t\t\t}\n\t\t});\n\t\tcompiler.hooks.shutdown.tapPromise(PLUGIN_NAME, async () => {\n\t\t\tthis.#tunnel?.close();\n\t\t\tconst created = await session?.catch(() => {});\n\t\t\tawait created?.dispose();\n\t\t});\n\t}\n}\n\nexport function cloudflare(options?: CloudflarePluginOptions) {\n\treturn new CloudflarePlugin(options);\n}\n"],"ignoreList":[11,12,13,14,15],"mappings":";;;;;;;;;;;;;;;;;;AAOA,MAAM,gBAA0D;CAC/D;EAAE,MAAM;EAAQ,OAAO;GAAC;GAAY;GAAa;EAAU;CAAE;CAC7D;EAAE,MAAM;EAAQ,OAAO,CAAC,UAAU;CAAE;CACpC;EAAE,MAAM;EAAgB,OAAO,CAAC,aAAa,kBAAkB;CAAE;AAClE;AAEA,MAAM,eAAkC;CAAC;CAAgB;CAAQ;AAAM;AAEvE,SAAS,aAAa,MAAkC;CACvD,OAAO,aAAa,SAAS,IAAI;AAClC;;AAGA,SAAgB,eAAe,QAAwB;CACtD,MAAM,wBAAQ,IAAI,IAAwB;CAC1C,KAAK,MAAM,QAAQ,CAAC,GAAG,OAAO,OAAO,OAAO,GAAG,aAAa,GAAG;EAC9D,IA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IN_NAME"],"sources":["../src/module-rules.ts","../src/nodejs-compat.ts","../src/worker-config.ts","../src/build.ts","../src/config.ts","../src/miniflare.ts","../workers-sdk/packages/workers-shared/utils/configuration/constants.ts","../workers-sdk/packages/workers-shared/utils/configuration/constructConfiguration.ts","../workers-sdk/packages/workers-shared/utils/configuration/validateURL.ts","../workers-sdk/packages/workers-shared/utils/configuration/parseHeaders.ts","../workers-sdk/packages/workers-shared/utils/configuration/parseRedirects.ts","../node_modules/ignore/index.js","../node_modules/mime/dist/types/other.js","../node_modules/mime/dist/types/standard.js","../node_modules/mime/dist/src/Mime.js","../node_modules/mime/dist/src/index.js","../workers-sdk/packages/workers-shared/utils/helpers.ts","../src/assets.ts","../src/containers.ts","../src/dev-entry.ts","../src/dev-worker.ts","../src/http.ts","../src/inspector.ts","../src/dev.ts","../src/tunnel.ts","../src/index.ts"],"sourcesContent":["import path from 'node:path';\n\nimport type { ResolvedWorker } from './config.js';\n\nexport type ModuleType = 'CompiledWasm' | 'Data' | 'Text';\n\n// wrangler's defaults, which apply after any rules in the config\nconst DEFAULT_RULES: { type: ModuleType; globs: string[]; }[] = [\n\t{ type: 'Text', globs: ['**/*.txt', '**/*.html', '**/*.sql'] },\n\t{ type: 'Data', globs: ['**/*.bin'] },\n\t{ type: 'CompiledWasm', globs: ['**/*.wasm', '**/*.wasm?module'] },\n];\n\nconst MODULE_TYPES: readonly string[] = ['CompiledWasm', 'Data', 'Text'] satisfies ModuleType[];\n\nfunction isModuleType(type: string): type is ModuleType {\n\treturn MODULE_TYPES.includes(type);\n}\n\n/** Maps file extensions to the non-JS module type wrangler would give them, with config rules taking precedence. */\nexport function getModuleTypes(worker: ResolvedWorker) {\n\tconst types = new Map<string, ModuleType>();\n\tfor (const rule of [...worker.config.rules, ...DEFAULT_RULES]) {\n\t\tif (!isModuleType(rule.type)) {\n\t\t\tcontinue;\n\t\t}\n\t\tfor (const glob of rule.globs) {\n\t\t\t// wrangler's module rules use `**/*.ext` style globs, so the extension is all that matters\n\t\t\tconst extension = path.extname(glob.replace(/\\?.*$/, ''));\n\t\t\tif (extension && !types.has(extension)) {\n\t\t\t\ttypes.set(extension, rule.type);\n\t\t\t}\n\t\t}\n\t}\n\treturn types;\n}\n","import { fileURLToPath } from 'node:url';\n\nimport { getCloudflarePreset } from '@cloudflare/unenv-preset';\n// from workers-utils rather than Miniflare, which comes from the user's wrangler and dropped this export in 5.20261103\nimport { getNodeCompat } from '@cloudflare/workers-utils';\nimport { defineEnv } from 'unenv';\n\nimport type { ResolvedWorker } from './config.js';\n\nexport interface NodeJsCompat {\n\t/** Builtin specifiers workerd provides natively, mapped to the specifier to import at runtime. */\n\texternals: Map<string, string>;\n\t/** Builtin specifiers workerd lacks, mapped to the unenv polyfill file that replaces them. */\n\tpolyfills: Map<string, string>;\n\t/** A module that sets up injected globals like `process` and runs polyfills, when the preset needs any. */\n\tinjectSource: string | undefined;\n}\n\nfunction resolvePolyfill(specifier: string) {\n\t// polyfills are this package's dependencies, which the user's project can't necessarily resolve\n\treturn fileURLToPath(import.meta.resolve(specifier));\n}\n\nfunction createInjectSource(inject: Record<string, string | readonly string[]>, polyfills: readonly string[]) {\n\tconst lines: string[] = [];\n\tfor (const [index, [globalName, specifier]] of Object.entries(inject).entries()) {\n\t\tconst [moduleSpecifier, exportName] = typeof specifier === 'string' ? [specifier, 'default'] : specifier;\n\t\tif (!moduleSpecifier || !exportName) {\n\t\t\tcontinue;\n\t\t}\n\t\tlines.push(\n\t\t\t`import { ${exportName} as inject${index} } from ${JSON.stringify(resolvePolyfill(moduleSpecifier))};`,\n\t\t\t`globalThis.${globalName} = inject${index};`,\n\t\t);\n\t}\n\tfor (const polyfill of polyfills) {\n\t\tlines.push(`import ${JSON.stringify(resolvePolyfill(polyfill))};`);\n\t}\n\treturn lines.length > 0 ? lines.join('\\n') : undefined;\n}\n\n/**\n * Applies Cloudflare's unenv preset, as wrangler and the Vite plugin do: modules workerd has natively stay external,\n * the rest are polyfilled, and globals like `process` are injected for older compatibility dates.\n */\nexport function getNodeJsCompat(worker: ResolvedWorker): NodeJsCompat | undefined {\n\tconst { compatibility_date: compatibilityDate, compatibility_flags: compatibilityFlags } = worker.config;\n\tif (!getNodeCompat(compatibilityDate, compatibilityFlags).isNodejsCompatEnabled) {\n\t\treturn undefined;\n\t}\n\tconst { env } = defineEnv({ presets: [getCloudflarePreset({ compatibilityDate, compatibilityFlags })] });\n\tconst nativeModules = new Set(env.external);\n\tconst externals = new Map<string, string>();\n\tconst polyfills = new Map<string, string>();\n\tfor (const [specifier, target] of Object.entries(env.alias)) {\n\t\tif (nativeModules.has(target)) {\n\t\t\texternals.set(specifier, target);\n\t\t} else {\n\t\t\tpolyfills.set(specifier, resolvePolyfill(target));\n\t\t}\n\t}\n\treturn { externals, polyfills, injectSource: createInjectSource(env.inject, env.polyfill) };\n}\n","import { createHash } from 'node:crypto';\nimport fs from 'node:fs';\nimport { isBuiltin } from 'node:module';\nimport path from 'node:path';\n\nimport { getModuleTypes } from './module-rules.js';\nimport { getNodeJsCompat } from './nodejs-compat.js';\n\nimport type { ResolvedWorker } from './config.js';\nimport type { ModuleType } from './module-rules.js';\nimport type { NodeJsCompat } from './nodejs-compat.js';\nimport type { CloudflarePluginOptions } from './options.js';\nimport type { Compiler, RspackOptions, RspackPluginInstance } from '@rspack/core';\n\n/** The rspack plugin that holds generated modules, which dev rewrites when the Worker's exports change. */\nexport type VirtualModules = InstanceType<Compiler['rspack']['experiments']['VirtualModulesPlugin']>;\n\nconst PLUGIN_NAME = 'rspack-plugin-cloudflare';\nconst TYPESCRIPT_RE = /\\.[cm]?tsx?$/;\n// the static asset types Vite also imports as URLs; .txt stays a Text module, as wrangler treats it\nconst ASSET_RE = /\\.(?:apng|avif|bmp|cur|eot|flac|gif|ico|jfif|jpe?g|jxl|m4a|mov|mp3|mp4|ogg|opus|otf|pdf|pjp|pjpeg|png|svg|ttf|vtt|wav|webm|webmanifest|webp|woff2?|aac)$/i;\n// `?url` imports any file as a URL, like Vite\nconst URL_QUERY_RE = /\\?(?:[^#]*&)?url(?:[&=#]|$)/;\n\n/** Output subdirectory for assets Worker code imports, laid out the way the assets directory serves them. */\nexport const IMPORTED_ASSETS_DIR = 'imported-assets';\n\ninterface AdditionalModule {\n\t/** File name in the output directory, which is also how the bundle imports it. */\n\tfileName: string;\n\ttype: 'CompiledWasm' | 'Data';\n}\n\n/** Copies imported `.wasm`/`.bin` files next to the bundle, where workerd loads them as their own modules. */\nexport class AdditionalModulesPlugin implements RspackPluginInstance {\n\treadonly #files = new Map<string, { sourcePath: string; type: AdditionalModule['type']; }>();\n\n\t/** Every file emitted so far; dev passes these to Miniflare, since rspack's incremental asset list can leave them out. */\n\tget modules(): AdditionalModule[] {\n\t\treturn [...this.#files].map(([fileName, { type }]) => {\n\t\t\treturn { fileName, type };\n\t\t});\n\t}\n\n\t/** Records a file to emit and returns the specifier the bundle should import it by. */\n\tadd(sourcePath: string, type: AdditionalModule['type']) {\n\t\tconst hash = createHash('sha1').update(fs.readFileSync(sourcePath)).digest('hex')\n\t\t\t.slice(0, 16);\n\t\tconst fileName = `${hash}-${path.basename(sourcePath)}`;\n\t\tthis.#files.set(fileName, { sourcePath, type });\n\t\treturn `./${fileName}`;\n\t}\n\n\tapply(compiler: Compiler) {\n\t\tconst { Compilation, sources } = compiler.rspack;\n\t\tcompiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation) => {\n\t\t\tcompilation.hooks.processAssets.tap({ name: PLUGIN_NAME, stage: Compilation.PROCESS_ASSETS_STAGE_ADDITIONAL }, () => {\n\t\t\t\tfor (const [fileName, { sourcePath }] of this.#files) {\n\t\t\t\t\tcompilation.emitAsset(fileName, new sources.RawSource(fs.readFileSync(sourcePath)));\n\t\t\t\t\tcompilation.fileDependencies.add(sourcePath);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}\n}\n\nfunction createExternals(nodeJsCompat: NodeJsCompat | undefined, moduleTypes: Map<string, ModuleType>, additionalModules: AdditionalModulesPlugin) {\n\ttype ExternalsCallback = (error?: Error, result?: string) => void;\n\treturn ({ request, context }: { request?: string; context?: string; }, callback: ExternalsCallback) => {\n\t\tif (!request) {\n\t\t\tcallback();\n\t\t\treturn;\n\t\t}\n\t\tif (request.startsWith('cloudflare:')) {\n\t\t\tcallback(undefined, request);\n\t\t\treturn;\n\t\t}\n\t\tif (nodeJsCompat) {\n\t\t\tconst native = nodeJsCompat.externals.get(request);\n\t\t\tif (native) {\n\t\t\t\tcallback(undefined, native);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// a builtin the preset doesn't know about yet; workerd only resolves the node: form\n\t\t\tif (isBuiltin(request) && !nodeJsCompat.polyfills.has(request)) {\n\t\t\t\tcallback(undefined, request.startsWith('node:') ? request : `node:${request}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tconst filePath = request.replace(/\\?.*$/, '');\n\t\tconst type = moduleTypes.get(path.extname(filePath));\n\t\tconst isModule = type === 'CompiledWasm' || type === 'Data';\n\t\tif (isModule && !URL_QUERY_RE.test(request) && context && (filePath.startsWith('.') || path.isAbsolute(filePath))) {\n\t\t\tcallback(undefined, additionalModules.add(path.resolve(context, filePath), type));\n\t\t\treturn;\n\t\t}\n\t\tcallback();\n\t};\n}\n\n/** Text modules inline as strings; with an assets directory, static files and `?url` imports become URLs served from it. */\nfunction getAssetRules(worker: ResolvedWorker, textExtensions: Set<string>) {\n\tconst textRule = { test: (file: string) => textExtensions.has(path.extname(file)), type: 'asset/source' };\n\tif (!worker.assets) {\n\t\treturn [textRule];\n\t}\n\tconst generator = {\n\t\tfilename: 'assets/[name].[contenthash:8][ext]',\n\t\toutputPath: IMPORTED_ASSETS_DIR,\n\t\t// served from the root of the assets directory, not the Worker's own public path\n\t\tpublicPath: '/',\n\t};\n\treturn [\n\t\t{ resourceQuery: URL_QUERY_RE, type: 'asset/resource', generator },\n\t\ttextRule,\n\t\t{ test: ASSET_RE, type: 'asset/resource', generator },\n\t];\n}\n\n/** Builds the rspack config for the Worker bundle: a single ESM file workerd can load as-is. */\nexport function createWorkerConfig(options: {\n\tcompiler: Compiler;\n\tworker: ResolvedWorker;\n\tpluginOptions: CloudflarePluginOptions;\n\toutputDir: string;\n\t/** The module to bundle. */\n\tentry: string;\n\t/** Source for `entry` when it isn't a real file, like dev's wrapper around `main`. */\n\tentrySource?: string;\n\tmode: 'development' | 'production';\n\t/** Builds in rspack's HMR runtime so dev can update the running Worker in place. */\n\thot?: boolean;\n\t/** Where HMR imports update chunks from; workerd has no import.meta.url to derive it from. */\n\tpublicPath?: string;\n}): { config: RspackOptions; virtualModules: VirtualModules; additionalModules: AdditionalModulesPlugin; } {\n\tconst { compiler, worker, pluginOptions, outputDir, entry, entrySource, mode, hot = false, publicPath = '/' } = options;\n\tconst { rspack } = compiler;\n\tconst moduleTypes = getModuleTypes(worker);\n\tconst textExtensions = new Set([...moduleTypes].filter(([, type]) => type === 'Text').map(([extension]) => extension));\n\tconst additionalModules = new AdditionalModulesPlugin();\n\tconst nodeJsCompat = getNodeJsCompat(worker);\n\n\tconst virtualModules: Record<string, string> = {};\n\tconst entries = [entry];\n\tif (entrySource !== undefined) {\n\t\tvirtualModules[entry] = entrySource;\n\t}\n\tif (nodeJsCompat?.injectSource) {\n\t\t// runs before the Worker so injected globals like `process` exist while its modules evaluate\n\t\tconst injectPath = path.join(worker.rootDir, '.wrangler', 'tmp', `rspack-${worker.name}`, 'nodejs-compat-inject.js');\n\t\tvirtualModules[injectPath] = nodeJsCompat.injectSource;\n\t\tentries.unshift(injectPath);\n\t}\n\n\tconst plugins: RspackPluginInstance[] = [\n\t\tnew rspack.DefinePlugin(worker.config.define),\n\t\t// workerd loads a single module here, so keep dynamic imports in the entry chunk\n\t\tnew rspack.optimize.LimitChunkCountPlugin({ maxChunks: 1 }),\n\t\tadditionalModules,\n\t];\n\tconst polyfills = nodeJsCompat?.polyfills;\n\tif (polyfills && polyfills.size > 0) {\n\t\t// rspack reads `node:` specifiers as a URL scheme that resolve.alias never sees, so swap polyfills in before resolving\n\t\tplugins.push(new rspack.NormalModuleReplacementPlugin(/^(?:node:)?[a-z_]/, (resource: { request: string; }) => {\n\t\t\tconst polyfill = polyfills.get(resource.request);\n\t\t\tif (polyfill) {\n\t\t\t\tresource.request = polyfill;\n\t\t\t}\n\t\t}));\n\t}\n\tconst virtualModulesPlugin = new rspack.experiments.VirtualModulesPlugin(virtualModules);\n\tplugins.push(virtualModulesPlugin);\n\tif (hot) {\n\t\tplugins.push(new rspack.HotModuleReplacementPlugin());\n\t}\n\n\tlet config: RspackOptions = {\n\t\tname: `cloudflare:${worker.name}`,\n\t\tmode,\n\t\tcontext: worker.rootDir,\n\t\ttarget: ['webworker', 'es2024'],\n\t\tentry: { index: entries },\n\t\toutput: {\n\t\t\tpath: outputDir,\n\t\t\tfilename: 'index.js',\n\t\t\tmodule: true,\n\t\t\tchunkFormat: 'module',\n\t\t\tlibrary: { type: 'module' },\n\t\t\tclean: true,\n\t\t\tpublicPath,\n\t\t},\n\t\texternalsType: 'module-import',\n\t\texternals: [createExternals(nodeJsCompat, moduleTypes, additionalModules)],\n\t\tresolve: {\n\t\t\textensions: ['.ts', '.tsx', '.mts', '.cts', '.js', '.mjs', '.cjs', '.json'],\n\t\t\textensionAlias: { '.js': ['.ts', '.tsx', '.js'], '.mjs': ['.mts', '.mjs'] },\n\t\t\tconditionNames: ['workerd', 'worker', 'browser', 'module', 'import', 'default'],\n\t\t\talias: worker.config.alias,\n\t\t},\n\t\tmodule: {\n\t\t\trules: [\n\t\t\t\t{\n\t\t\t\t\ttest: TYPESCRIPT_RE,\n\t\t\t\t\tloader: 'builtin:swc-loader',\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tjsc: {\n\t\t\t\t\t\t\tparser: { syntax: 'typescript', tsx: true, decorators: true },\n\t\t\t\t\t\t\ttarget: 'es2024',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\ttype: 'javascript/auto',\n\t\t\t\t},\n\t\t\t\t{ oneOf: getAssetRules(worker, textExtensions) },\n\t\t\t],\n\t\t},\n\t\tdevtool: 'source-map',\n\t\toptimization: {\n\t\t\t// follows wrangler's `minify`, since deploy can't minify an already bundled Worker; dev stays readable for debugging and HMR\n\t\t\tminimize: Boolean(worker.config.minify) && !hot,\n\t\t\t// a failed dev build must leave the last good bundle in place, since restarting another Worker reloads it from disk\n\t\t\temitOnErrors: false,\n\t\t},\n\t\tplugins,\n\t\tperformance: { hints: false },\n\t\twatchOptions: {\n\t\t\t// dev's generated entry is virtual and the bundle is written under .wrangler, so the watcher would see both as changes\n\t\t\tignored: /[/\\\\](?:\\.git|node_modules|\\.wrangler)[/\\\\]/,\n\t\t},\n\t\tstats: 'errors-warnings',\n\t\tinfrastructureLogging: compiler.options.infrastructureLogging,\n\t};\n\n\tif (pluginOptions.worker) {\n\t\tconfig = pluginOptions.worker(config, { name: worker.name }) ?? config;\n\t}\n\treturn { config, virtualModules: virtualModulesPlugin, additionalModules };\n}\n","import { existsSync } from 'node:fs';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\n\nimport { unstable_getVarsForDev } from 'wrangler';\n\nimport { IMPORTED_ASSETS_DIR, createWorkerConfig } from './worker-config.js';\n\nimport type { ResolvedWorker } from './config.js';\nimport type { CloudflarePluginOptions } from './options.js';\nimport type { Compiler, Stats } from '@rspack/core';\n\n// readConfig's file paths and bundling settings that rspack has already applied, so deploy must not apply them again. The\n// environment fields stay, since deploy checks --env against them and tags sibling environments with them\nconst OMITTED_CONFIG_KEYS = new Set([\n\t'configPath',\n\t'userConfigPath',\n\t'build',\n\t'define',\n\t'alias',\n\t'tsconfig',\n\t'find_additional_modules',\n\t'minify',\n\t'base_dir',\n\t'preserve_file_names',\n]);\n\n/** The Wrangler config `wrangler deploy` reads for the built Worker, with every path rebased onto the output directory. */\nexport function createOutputConfig(worker: ResolvedWorker) {\n\tconst rebase = (filePath: string) => path.relative(worker.outputDir, path.resolve(worker.rootDir, filePath)).replaceAll('\\\\', '/') || '.';\n\tconst config = Object.fromEntries(Object.entries(worker.config).filter(([key]) => !OMITTED_CONFIG_KEYS.has(key)));\n\t// readConfig always fills in `unsafe`, and wrangler warns about it being experimental even when empty\n\tif (worker.config.unsafe && Object.keys(worker.config.unsafe).length === 0) {\n\t\tdelete config.unsafe;\n\t}\n\n\t// wrangler's defaults already cover .wasm and .bin beside the bundle; custom binary rules have to come along\n\tconst binaryRules = worker.config.rules.filter(rule => rule.type === 'CompiledWasm' || rule.type === 'Data');\n\tconst bundled = worker.main\n\t\t? { main: 'index.js', no_bundle: true, rules: [{ type: 'ESModule', globs: ['**/*.js', '**/*.mjs'] }, ...binaryRules] }\n\t\t: { main: undefined };\n\n\treturn {\n\t\t...config,\n\t\t...bundled,\n\t\tassets: worker.assets ? { ...worker.config.assets, directory: rebase(worker.assets.directory) } : undefined,\n\t\tcontainers: worker.config.containers?.map((container) => {\n\t\t\tconst rebased = { ...container };\n\t\t\t// image is either a Dockerfile path or a registry reference; readConfig makes paths absolute, so only those need rebasing\n\t\t\tif (container.image && path.isAbsolute(container.image)) {\n\t\t\t\trebased.image = rebase(container.image);\n\t\t\t}\n\t\t\tif (container.image_build_context) {\n\t\t\t\trebased.image_build_context = rebase(container.image_build_context);\n\t\t\t}\n\t\t\treturn rebased;\n\t\t}),\n\t\tupload_source_maps: worker.config.upload_source_maps ?? true,\n\t};\n}\n\nasync function runCompiler(compiler: Compiler) {\n\ttry {\n\t\treturn await new Promise<Stats>((resolve, reject) => {\n\t\t\tcompiler.run((error, stats) => {\n\t\t\t\tif (error || !stats) {\n\t\t\t\t\treject(error ?? new Error('Worker build produced no stats'));\n\t\t\t\t} else {\n\t\t\t\t\tresolve(stats);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t} finally {\n\t\tawait new Promise<void>((resolve) => {\n\t\t\tcompiler.close(() => resolve());\n\t\t});\n\t}\n}\n\n/** The local secrets for this environment, written beside the build so `wrangler dev` can preview it like the Vite plugin's `vite preview`. */\nfunction createDevVars(worker: ResolvedWorker) {\n\tconst vars = unstable_getVarsForDev(worker.configPath, undefined, {}, worker.environment, true, worker.config.secrets);\n\tconst lines = Object.entries(vars).map(([key, binding]) => `${key}=${JSON.stringify(String(binding.value))}`);\n\treturn lines.length > 0 ? `${lines.join('\\n')}\\n` : undefined;\n}\n\n/** Bundles one Worker into its output directory beside the `wrangler.json` that deploys it, returning that config's path. */\nasync function buildWorker(compiler: Compiler, worker: ResolvedWorker, pluginOptions: CloudflarePluginOptions) {\n\tif (worker.main) {\n\t\tconst { config } = createWorkerConfig({\n\t\t\tcompiler,\n\t\t\tworker,\n\t\t\tpluginOptions,\n\t\t\toutputDir: worker.outputDir,\n\t\t\tentry: worker.main,\n\t\t\tmode: compiler.options.mode === 'production' ? 'production' : 'development',\n\t\t});\n\t\tconst workerCompiler = compiler.rspack.rspack(config);\n\t\tconst stats = await runCompiler(workerCompiler);\n\t\tif (stats.hasErrors()) {\n\t\t\tthrow new Error(`Worker \"${worker.name}\" build failed:\\n${stats.toString({ preset: 'errors-only', colors: false })}`);\n\t\t}\n\t} else {\n\t\tawait fs.rm(worker.outputDir, { recursive: true, force: true });\n\t\tawait fs.mkdir(worker.outputDir, { recursive: true });\n\t}\n\n\tconst outputConfigPath = path.join(worker.outputDir, 'wrangler.json');\n\tawait fs.writeFile(outputConfigPath, JSON.stringify(createOutputConfig(worker), null, '\\t'));\n\tconst devVars = createDevVars(worker);\n\tif (devVars) {\n\t\tawait fs.writeFile(path.join(worker.outputDir, '.dev.vars'), devVars);\n\t}\n\treturn outputConfigPath;\n}\n\n/** Moves assets the Worker imported into its assets directory, once the client build has emitted (and maybe cleaned) it. */\nexport async function copyImportedAssets(workers: ResolvedWorker[]) {\n\tfor (const worker of workers) {\n\t\tconst source = path.join(worker.outputDir, IMPORTED_ASSETS_DIR);\n\t\tif (!worker.assets || !existsSync(source)) {\n\t\t\tcontinue;\n\t\t}\n\t\tawait fs.cp(source, worker.assets.directory, { recursive: true });\n\t\tawait fs.rm(source, { recursive: true, force: true });\n\t}\n}\n\n/** Builds every Worker, entry first, and writes the redirect `wrangler deploy` follows to the built configs. */\nexport async function buildWorkers(options: { compiler: Compiler; workers: ResolvedWorker[]; pluginOptions: CloudflarePluginOptions; }) {\n\tconst { compiler, workers, pluginOptions } = options;\n\tconst [entry] = workers;\n\tif (!entry) {\n\t\treturn;\n\t}\n\tconst configPaths: string[] = [];\n\tfor (const worker of workers) {\n\t\tconfigPaths.push(await buildWorker(compiler, worker, pluginOptions));\n\t}\n\n\t// the same redirect @cloudflare/vite-plugin writes, so a plain `wrangler deploy` next to the user config deploys the build\n\tconst deployConfigPath = path.join(entry.rootDir, '.wrangler', 'deploy', 'config.json');\n\tconst relativeToDeploy = (filePath: string) => path.relative(path.dirname(deployConfigPath), filePath).replaceAll('\\\\', '/');\n\tconst [entryConfigPath, ...auxiliaryConfigPaths] = configPaths;\n\tawait fs.mkdir(path.dirname(deployConfigPath), { recursive: true });\n\tawait fs.writeFile(deployConfigPath, JSON.stringify({\n\t\tconfigPath: entryConfigPath && relativeToDeploy(entryConfigPath),\n\t\tauxiliaryWorkers: auxiliaryConfigPaths.map((configPath) => {\n\t\t\treturn { configPath: relativeToDeploy(configPath) };\n\t\t}),\n\t}));\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { convertToWranglerConfig, loadAndParseConfig } from '@cloudflare/config';\nimport { normalizeAndValidateConfig } from '@cloudflare/workers-utils';\nimport { unstable_readConfig } from 'wrangler';\n\nimport type {\n\tAuxiliaryWorkerOptions,\n\tCloudflarePluginOptions,\n\tWorkerConfig,\n\tWorkerConfigCustomizer,\n} from './options.js';\n\nconst CLOUDFLARE_CONFIG_FILE_NAME = 'cloudflare.config.ts';\nconst WRANGLER_CONFIG_FILE_NAMES = ['wrangler.jsonc', 'wrangler.json', 'wrangler.toml'];\n\nexport interface ResolvedWorker {\n\tconfig: WorkerConfig;\n\tconfigPath: string;\n\t/** The config file and every local file it imports, any of which changing means the config must be read again. */\n\tconfigFiles: string[];\n\tenvironment: string | undefined;\n\tname: string;\n\t/** Undefined for assets-only projects, which deploy static files without a Worker. */\n\tmain: string | undefined;\n\t/** Directory holding the Wrangler config; relative paths in the config resolve against it. */\n\trootDir: string;\n\tassets: {\n\t\tdirectory: string;\n\t\tbinding: string | undefined;\n\t} | undefined;\n\toutputDir: string;\n}\n\nfunction findConfigPath(context: string, configPath: string | undefined) {\n\tif (configPath) {\n\t\treturn path.resolve(context, configPath);\n\t}\n\t// projects often point rspack's context at a source folder, so walk up like wrangler does\n\tlet directory = context;\n\twhile (true) {\n\t\tconst cloudflareConfigPath = path.join(directory, CLOUDFLARE_CONFIG_FILE_NAME);\n\t\tconst wranglerConfigPath = WRANGLER_CONFIG_FILE_NAMES.map(fileName => path.join(directory, fileName)).find(candidate => fs.existsSync(candidate));\n\t\tif (fs.existsSync(cloudflareConfigPath)) {\n\t\t\t// mid-migration projects can have both, and quietly picking one would leave the other's edits ignored\n\t\t\tif (wranglerConfigPath) {\n\t\t\t\tthrow new Error(`Found both ${cloudflareConfigPath} and ${wranglerConfigPath}. Remove one, or choose one with the \\`configPath\\` option.`);\n\t\t\t}\n\t\t\treturn cloudflareConfigPath;\n\t\t}\n\t\tif (wranglerConfigPath) {\n\t\t\treturn wranglerConfigPath;\n\t\t}\n\t\tconst parent = path.dirname(directory);\n\t\tif (parent === directory) {\n\t\t\tthrow new Error(`No Cloudflare config found in ${context} or its parents. Looked for ${[CLOUDFLARE_CONFIG_FILE_NAME, ...WRANGLER_CONFIG_FILE_NAMES].join(', ')}.`);\n\t\t}\n\t\tdirectory = parent;\n\t}\n}\n\n/** Loads `cloudflare.config.ts` into the same Config wrangler reads from its own files, the way `wrangler --experimental-new-config` does. */\nasync function readCloudflareConfig(configPath: string, mode: string | undefined, clientOutputPath: string | undefined) {\n\tconst { result, dependencies } = await loadAndParseConfig(configPath, { isPreview: false, mode });\n\tif (!result.success) {\n\t\tconst issues = result.error.issues.map(issue => ` - ${issue.path.map(String).join('.') || '(root)'}: ${issue.message}`);\n\t\tthrow new Error(`Invalid ${configPath}:\\n${issues.join('\\n')}`);\n\t}\n\tif (!result.data.worker) {\n\t\tthrow new Error(`${configPath} must define a Worker using the \\`worker\\` property.`);\n\t}\n\tconst rawConfig = convertToWranglerConfig(result.data);\n\t// cloudflare.config.ts leaves the assets directory to the bundler, which Vite fills with its client build output\n\tif (rawConfig.assets && clientOutputPath) {\n\t\trawConfig.assets.directory = clientOutputPath;\n\t}\n\tconst { config, diagnostics } = normalizeAndValidateConfig(rawConfig, configPath, configPath, {}, true);\n\tif (diagnostics.hasErrors()) {\n\t\tthrow new Error(diagnostics.renderErrors());\n\t}\n\tif (diagnostics.hasWarnings()) {\n\t\tconsole.warn(diagnostics.renderWarnings());\n\t}\n\treturn { config, configFiles: [...new Set([configPath, ...dependencies])] };\n}\n\nasync function readConfig(configPath: string, environment: string | undefined, clientOutputPath: string | undefined) {\n\tif (path.basename(configPath) === CLOUDFLARE_CONFIG_FILE_NAME) {\n\t\t// cloudflare.config.ts has no Wrangler environments; it reads the environment as its mode instead\n\t\treturn readCloudflareConfig(configPath, environment, clientOutputPath);\n\t}\n\t// an explicit path skips wrangler's .wrangler/deploy redirect, which would otherwise point dev at our own build output\n\tconst config = unstable_readConfig({ config: configPath, env: environment }, { preserveOriginalMain: true });\n\treturn { config, configFiles: [configPath] };\n}\n\nfunction isInside(parent: string, child: string) {\n\tconst relative = path.relative(parent, child);\n\treturn relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));\n}\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** Deep-merges plain objects so an override like `{ vars: { A: '1' } }` keeps the other vars; arrays are replaced. */\nfunction mergeConfig(target: WorkerConfig | Record<string, unknown>, overrides: Partial<WorkerConfig> | Record<string, unknown>) {\n\tfor (const [key, value] of Object.entries(overrides)) {\n\t\tconst existing: unknown = Reflect.get(target, key);\n\t\tif (isPlainObject(existing) && isPlainObject(value)) {\n\t\t\tmergeConfig(existing, value);\n\t\t} else {\n\t\t\tReflect.set(target, key, value);\n\t\t}\n\t}\n}\n\nfunction applyCustomizer(config: WorkerConfig, customizer: WorkerConfigCustomizer | undefined) {\n\tif (!customizer) {\n\t\treturn;\n\t}\n\tconst overrides = typeof customizer === 'function' ? customizer(config) : customizer;\n\tif (overrides) {\n\t\tmergeConfig(config, overrides);\n\t}\n}\n\n/** Reads a Worker's config, with `clientOutputPath` (rspack's `output.path`) serving as the assets directory `cloudflare.config.ts` can't name. */\nexport async function resolveWorker(context: string, options: CloudflarePluginOptions, clientOutputPath?: string): Promise<ResolvedWorker> {\n\tconst configPath = findConfigPath(context, options.configPath);\n\tconst environment = options.environment ?? process.env.CLOUDFLARE_ENV;\n\tconst { config, configFiles } = await readConfig(configPath, environment, clientOutputPath);\n\tapplyCustomizer(config, options.config);\n\tconst rootDir = path.dirname(configPath);\n\n\tif (!config.main && !config.assets?.directory) {\n\t\tthrow new Error(`${configPath} needs a \\`main\\` Worker entry, or an \\`assets.directory\\` for an assets-only project.`);\n\t}\n\tif (!config.name) {\n\t\tthrow new Error(`${configPath} has no \\`name\\`.`);\n\t}\n\n\tconst assets = config.assets?.directory\n\t\t? { directory: path.resolve(rootDir, config.assets.directory), binding: config.assets.binding }\n\t\t: undefined;\n\tconst outputDir = path.resolve(rootDir, options.outputDir ?? path.join('dist', config.name));\n\n\t// anything in the assets directory is publicly served, so the Worker bundle can't live there\n\tif (assets && isInside(assets.directory, outputDir)) {\n\t\tthrow new Error(`outputDir (${outputDir}) is inside the assets directory (${assets.directory}); the Worker bundle would be publicly served.`);\n\t}\n\n\treturn {\n\t\tconfig,\n\t\tconfigPath,\n\t\tconfigFiles,\n\t\tenvironment,\n\t\tname: config.name,\n\t\tmain: config.main ? path.resolve(rootDir, config.main) : undefined,\n\t\trootDir,\n\t\tassets,\n\t\toutputDir,\n\t};\n}\n\n/** Resolves an auxiliary Worker, which only the entry Worker's service bindings reach, so it can't serve assets. */\nasync function resolveAuxiliaryWorker(context: string, options: CloudflarePluginOptions, auxiliary: AuxiliaryWorkerOptions, clientOutputPath: string | undefined) {\n\tconst worker = await resolveWorker(context, { ...auxiliary, environment: options.environment }, clientOutputPath);\n\tif (!worker.main) {\n\t\tthrow new Error(`Auxiliary Worker config ${worker.configPath} needs a \\`main\\` entry.`);\n\t}\n\tif (worker.assets) {\n\t\tthrow new Error(`Auxiliary Worker \"${worker.name}\" has \\`assets\\`, which only the entry Worker supports.`);\n\t}\n\treturn worker;\n}\n\n/** A resolver per Worker, entry first, so a config change can re-read just the Worker it belongs to. */\nexport function getWorkerResolvers(context: string, options: CloudflarePluginOptions, clientOutputPath: string | undefined): (() => Promise<ResolvedWorker>)[] {\n\treturn [\n\t\t() => resolveWorker(context, options, clientOutputPath),\n\t\t...(options.auxiliaryWorkers ?? []).map(auxiliary => () => resolveAuxiliaryWorker(context, options, auxiliary, clientOutputPath)),\n\t];\n}\n","import { createRequire } from 'node:module';\n\nimport type * as Miniflare from 'miniflare';\n\n// wrangler (a peer dependency) builds the Miniflare options, so run them with the Miniflare that version of wrangler ships\nconst requireFromWrangler = createRequire(import.meta.resolve('wrangler'));\n\nexport const miniflare = requireFromWrangler('miniflare') as typeof Miniflare;\n","export const REDIRECTS_VERSION = 1;\nexport const HEADERS_VERSION = 2;\n\nexport const PERMITTED_STATUS_CODES = new Set([200, 301, 302, 303, 307, 308]);\nexport const HEADER_SEPARATOR = \":\";\nexport const MAX_LINE_LENGTH = 2000;\nexport const MAX_HEADER_RULES = 100;\nexport const MAX_DYNAMIC_REDIRECT_RULES = 100;\nexport const MAX_STATIC_REDIRECT_RULES = 2000;\nexport const UNSET_OPERATOR = \"! \";\n\nexport const SPLAT_REGEX = /\\*/g;\nexport const PLACEHOLDER_REGEX = /:[A-Za-z]\\w*/g;\n\n/** Max number of rules in `run_worker_first` */\nexport const MAX_ROUTES_RULES = 100;\n/** Max char length of each rule in `run_worker_first` */\nexport const MAX_ROUTES_RULE_LENGTH = 100;\n","import { relative } from \"node:path\";\nimport {\n\tHEADERS_VERSION,\n\tPLACEHOLDER_REGEX,\n\tREDIRECTS_VERSION,\n\tSPLAT_REGEX,\n} from \"./constants\";\nimport type {\n\tAssetConfig,\n\tMetadataHeaders,\n\tMetadataRedirects,\n\tMetadataStaticRedirects,\n} from \"../types\";\nimport type { Logger, ParsedHeaders, ParsedRedirects } from \"./types\";\n\nexport function constructRedirects({\n\tredirects,\n\tredirectsFile,\n\tlogger,\n}: {\n\tredirects?: ParsedRedirects;\n\tredirectsFile?: string;\n\tlogger: Logger;\n}): Pick<AssetConfig, \"redirects\"> {\n\tif (!redirects) {\n\t\treturn {};\n\t}\n\n\tconst num_valid = redirects.rules.length;\n\tconst num_invalid = redirects.invalid.length;\n\n\t// exhaustive check, since we could not have parsed `redirects` out of\n\t// a non-existing redirects file\n\tconst redirectsRelativePath = redirectsFile\n\t\t? relative(process.cwd(), redirectsFile)\n\t\t: \"\";\n\n\tlogger.log(\n\t\t`✨ Parsed ${num_valid} valid redirect rule${num_valid === 1 ? \"\" : \"s\"}.`\n\t);\n\n\tif (num_invalid > 0) {\n\t\tlet invalidRedirectRulesList = ``;\n\n\t\tfor (const { line, lineNumber, message } of redirects.invalid) {\n\t\t\tinvalidRedirectRulesList += `▶︎ ${message}\\n`;\n\n\t\t\tif (line) {\n\t\t\t\tinvalidRedirectRulesList += ` at ${redirectsRelativePath}${lineNumber ? `:${lineNumber}` : \"\"} | ${line}\\n\\n`;\n\t\t\t}\n\t\t}\n\n\t\tlogger.warn(\n\t\t\t`Found ${num_invalid} invalid redirect rule${num_invalid === 1 ? \"\" : \"s\"}:\\n` +\n\t\t\t\t`${invalidRedirectRulesList}`\n\t\t);\n\t}\n\n\t/* Better to return no Redirects object at all than one with empty rules */\n\tif (num_valid === 0) {\n\t\treturn {};\n\t}\n\n\tconst staticRedirects: MetadataStaticRedirects = {};\n\tconst dynamicRedirects: MetadataRedirects = {};\n\tlet canCreateStaticRule = true;\n\tfor (const rule of redirects.rules) {\n\t\tif (!rule.from.match(SPLAT_REGEX) && !rule.from.match(PLACEHOLDER_REGEX)) {\n\t\t\tif (canCreateStaticRule) {\n\t\t\t\tstaticRedirects[rule.from] = {\n\t\t\t\t\tstatus: rule.status,\n\t\t\t\t\tto: rule.to,\n\t\t\t\t\tlineNumber: rule.lineNumber,\n\t\t\t\t};\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\tlogger.info(\n\t\t\t\t\t`The redirect rule ${rule.from} → ${rule.status} ${rule.to} could be made more performant by bringing it above any lines with splats or placeholders.`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tdynamicRedirects[rule.from] = { status: rule.status, to: rule.to };\n\t\tcanCreateStaticRule = false;\n\t}\n\n\treturn {\n\t\tredirects: {\n\t\t\tversion: REDIRECTS_VERSION,\n\t\t\tstaticRules: staticRedirects,\n\t\t\trules: dynamicRedirects,\n\t\t},\n\t};\n}\n\nexport function constructHeaders({\n\theaders,\n\theadersFile,\n\tlogger,\n}: {\n\theaders?: ParsedHeaders;\n\theadersFile?: string;\n\tlogger: Logger;\n}): Pick<AssetConfig, \"headers\"> {\n\tif (!headers) {\n\t\treturn {};\n\t}\n\n\tconst num_valid = headers.rules.length;\n\tconst num_invalid = headers.invalid.length;\n\n\t// exhaustive check, since we could not have parsed `headers` out of\n\t// a non-existing headers file\n\tconst headersRelativePath = headersFile\n\t\t? relative(process.cwd(), headersFile)\n\t\t: \"\";\n\n\tlogger.log(\n\t\t`✨ Parsed ${num_valid} valid header rule${num_valid === 1 ? \"\" : \"s\"}.`\n\t);\n\n\tif (num_invalid > 0) {\n\t\tlet invalidHeaderRulesList = ``;\n\n\t\tfor (const { line, lineNumber, message } of headers.invalid) {\n\t\t\tinvalidHeaderRulesList += `▶︎ ${message}\\n`;\n\n\t\t\tif (line) {\n\t\t\t\tinvalidHeaderRulesList += ` at ${headersRelativePath}${lineNumber ? `:${lineNumber}` : \"\"} | ${line}\\n\\n`;\n\t\t\t}\n\t\t}\n\n\t\tlogger.warn(\n\t\t\t`Found ${num_invalid} invalid header rule${num_invalid === 1 ? \"\" : \"s\"}:\\n` +\n\t\t\t\t`${invalidHeaderRulesList}`\n\t\t);\n\t}\n\n\t/* Better to return no Headers object at all than one with empty rules */\n\tif (num_valid === 0) {\n\t\treturn {};\n\t}\n\n\tconst rules: MetadataHeaders = {};\n\tfor (const rule of headers.rules) {\n\t\tconst configuredRule: MetadataHeaders[string] = {};\n\n\t\tif (Object.keys(rule.headers).length) {\n\t\t\tconfiguredRule.set = rule.headers;\n\t\t}\n\t\tif (rule.unsetHeaders.length) {\n\t\t\tconfiguredRule.unset = rule.unsetHeaders;\n\t\t}\n\n\t\trules[rule.path] = configuredRule;\n\t}\n\n\treturn {\n\t\theaders: {\n\t\t\tversion: HEADERS_VERSION,\n\t\t\trules,\n\t\t},\n\t};\n}\n","export const extractPathname = (\n\tpath = \"/\",\n\tincludeSearch: boolean,\n\tincludeHash: boolean\n): string => {\n\tif (!path.startsWith(\"/\")) {\n\t\tpath = `/${path}`;\n\t}\n\tconst url = new URL(`//${path}`, \"relative://\");\n\treturn `${url.pathname}${includeSearch ? url.search : \"\"}${\n\t\tincludeHash ? url.hash : \"\"\n\t}`;\n};\n\nconst URL_REGEX = /^https:\\/\\/+(?<host>[^/]+)\\/?(?<path>.*)/;\nconst HOST_WITH_PORT_REGEX = /.*:\\d+$/;\nconst PATH_REGEX = /^\\//;\n\nexport const validateUrl = (\n\ttoken: string,\n\tonlyRelative = false,\n\tdisallowPorts = false,\n\tincludeSearch = false,\n\tincludeHash = false\n): [undefined, string] | [string, undefined] => {\n\tconst host = URL_REGEX.exec(token);\n\tif (host && host.groups && host.groups.host) {\n\t\tif (onlyRelative) {\n\t\t\treturn [\n\t\t\t\tundefined,\n\t\t\t\t`Only relative URLs are allowed. Skipping absolute URL ${token}.`,\n\t\t\t];\n\t\t}\n\n\t\tif (disallowPorts && host.groups.host.match(HOST_WITH_PORT_REGEX)) {\n\t\t\treturn [\n\t\t\t\tundefined,\n\t\t\t\t`Specifying ports is not supported. Skipping absolute URL ${token}.`,\n\t\t\t];\n\t\t}\n\n\t\treturn [\n\t\t\t`https://${host.groups.host}${extractPathname(\n\t\t\t\thost.groups.path,\n\t\t\t\tincludeSearch,\n\t\t\t\tincludeHash\n\t\t\t)}`,\n\t\t\tundefined,\n\t\t];\n\t} else {\n\t\tif (!token.startsWith(\"/\") && onlyRelative) {\n\t\t\ttoken = `/${token}`;\n\t\t}\n\n\t\tconst path = PATH_REGEX.exec(token);\n\t\tif (path) {\n\t\t\ttry {\n\t\t\t\treturn [extractPathname(token, includeSearch, includeHash), undefined];\n\t\t\t} catch {\n\t\t\t\treturn [undefined, `Error parsing URL segment ${token}. Skipping.`];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn [\n\t\tundefined,\n\t\tonlyRelative\n\t\t\t? \"URLs should begin with a forward-slash.\"\n\t\t\t: 'URLs should either be relative (e.g. begin with a forward-slash), or use HTTPS (e.g. begin with \"https://\").',\n\t];\n};\n\nexport function urlHasHost(token: string): boolean {\n\tconst host = URL_REGEX.exec(token);\n\treturn Boolean(host && host.groups && host.groups.host);\n}\n","import {\n\tHEADER_SEPARATOR,\n\tMAX_HEADER_RULES,\n\tMAX_LINE_LENGTH,\n\tSPLAT_REGEX,\n\tUNSET_OPERATOR,\n} from \"./constants\";\nimport { validateUrl } from \"./validateURL\";\nimport type { HeadersRule, InvalidHeadersRule, ParsedHeaders } from \"./types\";\n\n// Not strictly necessary to check for all protocols-like beginnings, since _technically_ that could be a legit header (e.g. name=http, value=://I'm a value).\n// But we're checking here since some people might be caught out and it'll help 99.9% of people who get it wrong.\n// We do the proper validation in `validateUrl` anyway :)\nconst LINE_IS_PROBABLY_A_PATH = new RegExp(/^([^\\s]+:\\/\\/|^\\/)/);\n\nexport function parseHeaders(\n\tinput: string,\n\t{\n\t\tmaxRules = MAX_HEADER_RULES,\n\t\tmaxLineLength = MAX_LINE_LENGTH,\n\t}: { maxRules?: number; maxLineLength?: number } = {}\n): ParsedHeaders {\n\tconst lines = input.split(\"\\n\");\n\tconst rules: HeadersRule[] = [];\n\tconst invalid: InvalidHeadersRule[] = [];\n\n\tlet rule: (HeadersRule & { line: string }) | undefined = undefined;\n\t// When a path line is rejected (invalid URL, multiple wildcards, etc.),\n\t// we silently skip subsequent header lines until the next path line\n\t// rather than emitting confusing \"Path should come before header\" errors.\n\tlet skipUntilNextPath = false;\n\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tconst line = (lines[i] || \"\").trim();\n\t\tif (line.length === 0 || line.startsWith(\"#\")) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (line.length > maxLineLength) {\n\t\t\tinvalid.push({\n\t\t\t\tmessage: `Ignoring line ${\n\t\t\t\t\ti + 1\n\t\t\t\t} as it exceeds the maximum allowed length of ${maxLineLength}.`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (LINE_IS_PROBABLY_A_PATH.test(line)) {\n\t\t\tskipUntilNextPath = false;\n\n\t\t\tif (rules.length >= maxRules) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tmessage: `Maximum number of rules supported is ${maxRules}. Skipping remaining ${\n\t\t\t\t\t\tlines.length - i\n\t\t\t\t\t} lines of file.`,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif (rule) {\n\t\t\t\tif (isValidRule(rule)) {\n\t\t\t\t\trules.push({\n\t\t\t\t\t\tpath: rule.path,\n\t\t\t\t\t\theaders: rule.headers,\n\t\t\t\t\t\tunsetHeaders: rule.unsetHeaders,\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\tinvalid.push({\n\t\t\t\t\t\tline: rule.line,\n\t\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\t\tmessage: \"No headers specified\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tconst [path, pathError] = validateUrl(line, false, true);\n\t\t\tif (pathError) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tline,\n\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\tmessage: pathError,\n\t\t\t\t});\n\t\t\t\trule = undefined;\n\t\t\t\tskipUntilNextPath = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst wildcardError = validateNoMultipleWildcards(path as string);\n\t\t\tif (wildcardError) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tline,\n\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\tmessage: wildcardError,\n\t\t\t\t});\n\t\t\t\trule = undefined;\n\t\t\t\tskipUntilNextPath = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\trule = {\n\t\t\t\tpath: path as string,\n\t\t\t\tline,\n\t\t\t\theaders: {},\n\t\t\t\tunsetHeaders: [],\n\t\t\t};\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (skipUntilNextPath) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!line.includes(HEADER_SEPARATOR)) {\n\t\t\tif (!rule) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tline,\n\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\tmessage: \"Expected a path beginning with at least one forward-slash\",\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (line.trim().startsWith(UNSET_OPERATOR)) {\n\t\t\t\t\trule.unsetHeaders.push(line.trim().replace(UNSET_OPERATOR, \"\"));\n\t\t\t\t} else {\n\t\t\t\t\tinvalid.push({\n\t\t\t\t\t\tline,\n\t\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\"Expected a colon-separated header pair (e.g. name: value)\",\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [rawName, ...rawValue] = line.split(HEADER_SEPARATOR);\n\t\tconst name = (rawName || \"\").trim().toLowerCase();\n\n\t\tif (name.includes(\" \")) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: \"Header name cannot include spaces\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst value = rawValue.join(HEADER_SEPARATOR).trim();\n\n\t\tif (name === \"\") {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: \"No header name specified\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (value === \"\") {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: \"No header value specified\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (!rule) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: `Path should come before header (${name}: ${value})`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst existingValues = rule.headers[name];\n\t\trule.headers[name] = existingValues ? `${existingValues}, ${value}` : value;\n\t}\n\n\tif (rule) {\n\t\tif (isValidRule(rule)) {\n\t\t\trules.push({\n\t\t\t\tpath: rule.path,\n\t\t\t\theaders: rule.headers,\n\t\t\t\tunsetHeaders: rule.unsetHeaders,\n\t\t\t});\n\t\t} else {\n\t\t\tinvalid.push({ line: rule.line, message: \"No headers specified\" });\n\t\t}\n\t}\n\n\treturn {\n\t\trules,\n\t\tinvalid,\n\t};\n}\n\nfunction isValidRule(rule: HeadersRule) {\n\treturn Object.keys(rule.headers).length > 0 || rule.unsetHeaders.length > 0;\n}\n\n/**\n * At runtime, `*` wildcards are converted to `:splat` placeholders. This means\n * a path with multiple wildcards, or a wildcard combined with an explicit\n * `:splat` placeholder, would result in duplicate `:splat` parameters which is\n * unsupported.\n */\nfunction validateNoMultipleWildcards(path: string): string | undefined {\n\tconst wildcardCount = (path.match(SPLAT_REGEX) ?? []).length;\n\tconst hasSplatPlaceholder = /:splat(?!\\w)/.test(path);\n\n\tif (wildcardCount > 1) {\n\t\treturn `Only one wildcard is allowed per rule. Use a named placeholder (e.g. :project) instead. Skipping ${path}.`;\n\t}\n\n\tif (wildcardCount > 0 && hasSplatPlaceholder) {\n\t\treturn `Cannot combine a wildcard * with a :splat placeholder because wildcards are converted to :splat at runtime. Skipping ${path}.`;\n\t}\n\n\treturn undefined;\n}\n","import {\n\tMAX_DYNAMIC_REDIRECT_RULES,\n\tMAX_LINE_LENGTH,\n\tMAX_STATIC_REDIRECT_RULES,\n\tPERMITTED_STATUS_CODES,\n\tPLACEHOLDER_REGEX,\n\tSPLAT_REGEX,\n} from \"./constants\";\nimport { urlHasHost, validateUrl } from \"./validateURL\";\nimport type { AssetConfig } from \"../types\";\nimport type {\n\tInvalidRedirectRule,\n\tParsedRedirects,\n\tRedirectLine,\n\tRedirectRule,\n} from \"./types\";\n\nexport function parseRedirects(\n\tinput: string,\n\t{\n\t\thtmlHandling = undefined,\n\t\tmaxStaticRules = MAX_STATIC_REDIRECT_RULES,\n\t\tmaxDynamicRules = MAX_DYNAMIC_REDIRECT_RULES,\n\t\tmaxLineLength = MAX_LINE_LENGTH,\n\t}: {\n\t\thtmlHandling?: AssetConfig[\"html_handling\"];\n\t\tmaxStaticRules?: number;\n\t\tmaxDynamicRules?: number;\n\t\tmaxLineLength?: number;\n\t} = {}\n): ParsedRedirects {\n\tconst lines = input.split(\"\\n\");\n\tconst rules: RedirectRule[] = [];\n\tconst seen_paths = new Set<string>();\n\tconst invalid: InvalidRedirectRule[] = [];\n\n\tlet staticRules = 0;\n\tlet dynamicRules = 0;\n\tlet canCreateStaticRule = true;\n\n\tfor (let i = 0; i < lines.length; i++) {\n\t\tconst line = (lines[i] || \"\").trim();\n\t\tif (line.length === 0 || line.startsWith(\"#\")) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (line.length > maxLineLength) {\n\t\t\tinvalid.push({\n\t\t\t\tmessage: `Ignoring line ${\n\t\t\t\t\ti + 1\n\t\t\t\t} as it exceeds the maximum allowed length of ${maxLineLength}.`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Handle inline comments: strip off from the first `#` token that starts a comment, but not URL fragments.\n\t\t// This allows `/a /b#fragment` but strips `/a /b # comment`\n\t\tconst tokens = line.replace(/\\s+#.*$/, \"\").split(/\\s+/);\n\n\t\tif (tokens.length < 2 || tokens.length > 3) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: `Expected exactly 2 or 3 whitespace-separated tokens. Got ${tokens.length}.`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst [str_from, str_to, str_status = \"302\"] = tokens as RedirectLine;\n\n\t\tconst fromResult = validateUrl(str_from, true, true, false, false);\n\t\tif (fromResult[0] === undefined) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: fromResult[1],\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst from = fromResult[0];\n\n\t\tif (\n\t\t\tcanCreateStaticRule &&\n\t\t\t!from.match(SPLAT_REGEX) &&\n\t\t\t!from.match(PLACEHOLDER_REGEX)\n\t\t) {\n\t\t\tstaticRules += 1;\n\n\t\t\tif (staticRules > maxStaticRules) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tmessage: `Maximum number of static rules supported is ${maxStaticRules}. Skipping line.`,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t} else {\n\t\t\tdynamicRules += 1;\n\t\t\tcanCreateStaticRule = false;\n\n\t\t\tif (dynamicRules > maxDynamicRules) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tmessage: `Maximum number of dynamic rules supported is ${maxDynamicRules}. Skipping remaining ${\n\t\t\t\t\t\tlines.length - i\n\t\t\t\t\t} lines of file.`,\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tconst toResult = validateUrl(str_to, false, false, true, true);\n\t\tif (toResult[0] === undefined) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: toResult[1],\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tconst to = toResult[0];\n\n\t\tconst status = Number(str_status);\n\t\tif (isNaN(status) || !PERMITTED_STATUS_CODES.has(status)) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: `Valid status codes are 200, 301, 302 (default), 303, 307, or 308. Got ${str_status}.`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Here we reject two patterns:\n\t\t// 1. `/* /index.html` Is always rejected.\n\t\t// 2. `/ /index` Is rejected when HTML handling is enabled.\n\t\t// Allowing the redirect in other cases will cause TOO_MANY_REDIRECTS errors as the asset Worker will\n\t\t// redirect it back to `/` by removing the `/index.html`.\n\t\t// We only want to run this on relative URLs.\n\t\tconst hasRelativePath = !urlHasHost(to);\n\t\tconst hasWildcardToIndex =\n\t\t\tfrom.endsWith(\"/*\") && /\\/index(.html)?$/.test(to);\n\t\tconst hasRootToIndex = from.endsWith(\"/\") && /\\/index(.html)?$/.test(to);\n\t\tconst hasHTMLHandling = htmlHandling !== \"none\"; // HTML handling is enabled by default.\n\t\tif (\n\t\t\thasRelativePath &&\n\t\t\t(hasWildcardToIndex || (hasRootToIndex && hasHTMLHandling))\n\t\t) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage:\n\t\t\t\t\t\"Infinite loop detected in this rule and has been ignored. This will cause a redirect to strip `.html` or `/index` and end up triggering this rule again. Please fix or remove this rule to silence this warning.\",\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (seen_paths.has(from)) {\n\t\t\tinvalid.push({\n\t\t\t\tline,\n\t\t\t\tlineNumber: i + 1,\n\t\t\t\tmessage: `Ignoring duplicate rule for path ${from}.`,\n\t\t\t});\n\t\t\tcontinue;\n\t\t}\n\t\tseen_paths.add(from);\n\n\t\tif (status === 200) {\n\t\t\tif (urlHasHost(to)) {\n\t\t\t\tinvalid.push({\n\t\t\t\t\tline,\n\t\t\t\t\tlineNumber: i + 1,\n\t\t\t\t\tmessage: `Proxy (200) redirects can only point to relative paths. Got ${to}`,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\trules.push({ from, to, status, lineNumber: i + 1 });\n\t}\n\n\treturn {\n\t\trules,\n\t\tinvalid,\n\t};\n}\n","// A simple implementation of make-array\nfunction makeArray (subject) {\n return Array.isArray(subject)\n ? subject\n : [subject]\n}\n\nconst EMPTY = ''\nconst SPACE = ' '\nconst ESCAPE = '\\\\'\nconst REGEX_TEST_BLANK_LINE = /^\\s+$/\nconst REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\\\]|^)\\\\$/\nconst REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\\\!/\nconst REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\\\#/\nconst REGEX_SPLITALL_CRLF = /\\r?\\n/g\n// /foo,\n// ./foo,\n// ../foo,\n// .\n// ..\nconst REGEX_TEST_INVALID_PATH = /^\\.*\\/|^\\.+$/\n\nconst SLASH = '/'\n\n// Do not use ternary expression here, since \"istanbul ignore next\" is buggy\nlet TMP_KEY_IGNORE = 'node-ignore'\n/* istanbul ignore else */\nif (typeof Symbol !== 'undefined') {\n TMP_KEY_IGNORE = Symbol.for('node-ignore')\n}\nconst KEY_IGNORE = TMP_KEY_IGNORE\n\nconst define = (object, key, value) =>\n Object.defineProperty(object, key, {value})\n\nconst REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g\n\nconst RETURN_FALSE = () => false\n\n// Sanitize the range of a regular expression\n// The cases are complicated, see test cases for details\nconst sanitizeRange = range => range.replace(\n REGEX_REGEXP_RANGE,\n (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0)\n ? match\n // Invalid range (out of order) which is ok for gitignore rules but\n // fatal for JavaScript regular expression, so eliminate it.\n : EMPTY\n)\n\n// See fixtures #59\nconst cleanRangeBackSlash = slashes => {\n const {length} = slashes\n return slashes.slice(0, length - length % 2)\n}\n\n// > If the pattern ends with a slash,\n// > it is removed for the purpose of the following description,\n// > but it would only find a match with a directory.\n// > In other words, foo/ will match a directory foo and paths underneath it,\n// > but will not match a regular file or a symbolic link foo\n// > (this is consistent with the way how pathspec works in general in Git).\n// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`'\n// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call\n// you could use option `mark: true` with `glob`\n\n// '`foo/`' should not continue with the '`..`'\nconst REPLACERS = [\n\n [\n // remove BOM\n // TODO:\n // Other similar zero-width characters?\n /^\\uFEFF/,\n () => EMPTY\n ],\n\n // > Trailing spaces are ignored unless they are quoted with backslash (\"\\\")\n [\n // (a\\ ) -> (a )\n // (a ) -> (a)\n // (a ) -> (a)\n // (a \\ ) -> (a )\n /((?:\\\\\\\\)*?)(\\\\?\\s+)$/,\n (_, m1, m2) => m1 + (\n m2.indexOf('\\\\') === 0\n ? SPACE\n : EMPTY\n )\n ],\n\n // replace (\\ ) with ' '\n // (\\ ) -> ' '\n // (\\\\ ) -> '\\\\ '\n // (\\\\\\ ) -> '\\\\ '\n [\n /(\\\\+?)\\s/g,\n (_, m1) => {\n const {length} = m1\n return m1.slice(0, length - length % 2) + SPACE\n }\n ],\n\n // Escape metacharacters\n // which is written down by users but means special for regular expressions.\n\n // > There are 12 characters with special meanings:\n // > - the backslash \\,\n // > - the caret ^,\n // > - the dollar sign $,\n // > - the period or dot .,\n // > - the vertical bar or pipe symbol |,\n // > - the question mark ?,\n // > - the asterisk or star *,\n // > - the plus sign +,\n // > - the opening parenthesis (,\n // > - the closing parenthesis ),\n // > - and the opening square bracket [,\n // > - the opening curly brace {,\n // > These special characters are often called \"metacharacters\".\n [\n /[\\\\$.|*+(){^]/g,\n match => `\\\\${match}`\n ],\n\n [\n // > a question mark (?) matches a single character\n /(?!\\\\)\\?/g,\n () => '[^/]'\n ],\n\n // leading slash\n [\n\n // > A leading slash matches the beginning of the pathname.\n // > For example, \"/*.c\" matches \"cat-file.c\" but not \"mozilla-sha1/sha1.c\".\n // A leading slash matches the beginning of the pathname\n /^\\//,\n () => '^'\n ],\n\n // replace special metacharacter slash after the leading slash\n [\n /\\//g,\n () => '\\\\/'\n ],\n\n [\n // > A leading \"**\" followed by a slash means match in all directories.\n // > For example, \"**/foo\" matches file or directory \"foo\" anywhere,\n // > the same as pattern \"foo\".\n // > \"**/foo/bar\" matches file or directory \"bar\" anywhere that is directly\n // > under directory \"foo\".\n // Notice that the '*'s have been replaced as '\\\\*'\n /^\\^*\\\\\\*\\\\\\*\\\\\\//,\n\n // '**/foo' <-> 'foo'\n () => '^(?:.*\\\\/)?'\n ],\n\n // starting\n [\n // there will be no leading '/'\n // (which has been replaced by section \"leading slash\")\n // If starts with '**', adding a '^' to the regular expression also works\n /^(?=[^^])/,\n function startingReplacer () {\n // If has a slash `/` at the beginning or middle\n return !/\\/(?!$)/.test(this)\n // > Prior to 2.22.1\n // > If the pattern does not contain a slash /,\n // > Git treats it as a shell glob pattern\n // Actually, if there is only a trailing slash,\n // git also treats it as a shell glob pattern\n\n // After 2.22.1 (compatible but clearer)\n // > If there is a separator at the beginning or middle (or both)\n // > of the pattern, then the pattern is relative to the directory\n // > level of the particular .gitignore file itself.\n // > Otherwise the pattern may also match at any level below\n // > the .gitignore level.\n ? '(?:^|\\\\/)'\n\n // > Otherwise, Git treats the pattern as a shell glob suitable for\n // > consumption by fnmatch(3)\n : '^'\n }\n ],\n\n // two globstars\n [\n // Use lookahead assertions so that we could match more than one `'/**'`\n /\\\\\\/\\\\\\*\\\\\\*(?=\\\\\\/|$)/g,\n\n // Zero, one or several directories\n // should not use '*', or it will be replaced by the next replacer\n\n // Check if it is not the last `'/**'`\n (_, index, str) => index + 6 < str.length\n\n // case: /**/\n // > A slash followed by two consecutive asterisks then a slash matches\n // > zero or more directories.\n // > For example, \"a/**/b\" matches \"a/b\", \"a/x/b\", \"a/x/y/b\" and so on.\n // '/**/'\n ? '(?:\\\\/[^\\\\/]+)*'\n\n // case: /**\n // > A trailing `\"/**\"` matches everything inside.\n\n // #21: everything inside but it should not include the current folder\n : '\\\\/.+'\n ],\n\n // normal intermediate wildcards\n [\n // Never replace escaped '*'\n // ignore rule '\\*' will match the path '*'\n\n // 'abc.*/' -> go\n // 'abc.*' -> skip this rule,\n // coz trailing single wildcard will be handed by [trailing wildcard]\n /(^|[^\\\\]+)(\\\\\\*)+(?=.+)/g,\n\n // '*.js' matches '.js'\n // '*.js' doesn't match 'abc'\n (_, p1, p2) => {\n // 1.\n // > An asterisk \"*\" matches anything except a slash.\n // 2.\n // > Other consecutive asterisks are considered regular asterisks\n // > and will match according to the previous rules.\n const unescaped = p2.replace(/\\\\\\*/g, '[^\\\\/]*')\n return p1 + unescaped\n }\n ],\n\n [\n // unescape, revert step 3 except for back slash\n // For example, if a user escape a '\\\\*',\n // after step 3, the result will be '\\\\\\\\\\\\*'\n /\\\\\\\\\\\\(?=[$.|*+(){^])/g,\n () => ESCAPE\n ],\n\n [\n // '\\\\\\\\' -> '\\\\'\n /\\\\\\\\/g,\n () => ESCAPE\n ],\n\n [\n // > The range notation, e.g. [a-zA-Z],\n // > can be used to match one of the characters in a range.\n\n // `\\` is escaped by step 3\n /(\\\\)?\\[([^\\]/]*?)(\\\\*)($|\\])/g,\n (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE\n // '\\\\[bar]' -> '\\\\\\\\[bar\\\\]'\n ? `\\\\[${range}${cleanRangeBackSlash(endEscape)}${close}`\n : close === ']'\n ? endEscape.length % 2 === 0\n // A normal case, and it is a range notation\n // '[bar]'\n // '[bar\\\\\\\\]'\n ? `[${sanitizeRange(range)}${endEscape}]`\n // Invalid range notaton\n // '[bar\\\\]' -> '[bar\\\\\\\\]'\n : '[]'\n : '[]'\n ],\n\n // ending\n [\n // 'js' will not match 'js.'\n // 'ab' will not match 'abc'\n /(?:[^*])$/,\n\n // WTF!\n // https://git-scm.com/docs/gitignore\n // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)\n // which re-fixes #24, #38\n\n // > If there is a separator at the end of the pattern then the pattern\n // > will only match directories, otherwise the pattern can match both\n // > files and directories.\n\n // 'js*' will not match 'a.js'\n // 'js/' will not match 'a.js'\n // 'js' will match 'a.js' and 'a.js/'\n match => /\\/$/.test(match)\n // foo/ will not match 'foo'\n ? `${match}$`\n // foo matches 'foo' and 'foo/'\n : `${match}(?=$|\\\\/$)`\n ],\n\n // trailing wildcard\n [\n /(\\^|\\\\\\/)?\\\\\\*$/,\n (_, p1) => {\n const prefix = p1\n // '\\^':\n // '/*' does not match EMPTY\n // '/*' does not match everything\n\n // '\\\\\\/':\n // 'abc/*' does not match 'abc/'\n ? `${p1}[^/]+`\n\n // 'a*' matches 'a'\n // 'a*' matches 'aa'\n : '[^/]*'\n\n return `${prefix}(?=$|\\\\/$)`\n }\n ],\n]\n\n// A simple cache, because an ignore rule only has only one certain meaning\nconst regexCache = Object.create(null)\n\n// @param {pattern}\nconst makeRegex = (pattern, ignoreCase) => {\n let source = regexCache[pattern]\n\n if (!source) {\n source = REPLACERS.reduce(\n (prev, [matcher, replacer]) =>\n prev.replace(matcher, replacer.bind(pattern)),\n pattern\n )\n regexCache[pattern] = source\n }\n\n return ignoreCase\n ? new RegExp(source, 'i')\n : new RegExp(source)\n}\n\nconst isString = subject => typeof subject === 'string'\n\n// > A blank line matches no files, so it can serve as a separator for readability.\nconst checkPattern = pattern => pattern\n && isString(pattern)\n && !REGEX_TEST_BLANK_LINE.test(pattern)\n && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)\n\n // > A line starting with # serves as a comment.\n && pattern.indexOf('#') !== 0\n\nconst splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF)\n\nclass IgnoreRule {\n constructor (\n origin,\n pattern,\n negative,\n regex\n ) {\n this.origin = origin\n this.pattern = pattern\n this.negative = negative\n this.regex = regex\n }\n}\n\nconst createRule = (pattern, ignoreCase) => {\n const origin = pattern\n let negative = false\n\n // > An optional prefix \"!\" which negates the pattern;\n if (pattern.indexOf('!') === 0) {\n negative = true\n pattern = pattern.substr(1)\n }\n\n pattern = pattern\n // > Put a backslash (\"\\\") in front of the first \"!\" for patterns that\n // > begin with a literal \"!\", for example, `\"\\!important!.txt\"`.\n .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!')\n // > Put a backslash (\"\\\") in front of the first hash for patterns that\n // > begin with a hash.\n .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#')\n\n const regex = makeRegex(pattern, ignoreCase)\n\n return new IgnoreRule(\n origin,\n pattern,\n negative,\n regex\n )\n}\n\nconst throwError = (message, Ctor) => {\n throw new Ctor(message)\n}\n\nconst checkPath = (path, originalPath, doThrow) => {\n if (!isString(path)) {\n return doThrow(\n `path must be a string, but got \\`${originalPath}\\``,\n TypeError\n )\n }\n\n // We don't know if we should ignore EMPTY, so throw\n if (!path) {\n return doThrow(`path must not be empty`, TypeError)\n }\n\n // Check if it is a relative path\n if (checkPath.isNotRelative(path)) {\n const r = '`path.relative()`d'\n return doThrow(\n `path should be a ${r} string, but got \"${originalPath}\"`,\n RangeError\n )\n }\n\n return true\n}\n\nconst isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path)\n\ncheckPath.isNotRelative = isNotRelative\ncheckPath.convert = p => p\n\nclass Ignore {\n constructor ({\n ignorecase = true,\n ignoreCase = ignorecase,\n allowRelativePaths = false\n } = {}) {\n define(this, KEY_IGNORE, true)\n\n this._rules = []\n this._ignoreCase = ignoreCase\n this._allowRelativePaths = allowRelativePaths\n this._initCache()\n }\n\n _initCache () {\n this._ignoreCache = Object.create(null)\n this._testCache = Object.create(null)\n }\n\n _addPattern (pattern) {\n // #32\n if (pattern && pattern[KEY_IGNORE]) {\n this._rules = this._rules.concat(pattern._rules)\n this._added = true\n return\n }\n\n if (checkPattern(pattern)) {\n const rule = createRule(pattern, this._ignoreCase)\n this._added = true\n this._rules.push(rule)\n }\n }\n\n // @param {Array<string> | string | Ignore} pattern\n add (pattern) {\n this._added = false\n\n makeArray(\n isString(pattern)\n ? splitPattern(pattern)\n : pattern\n ).forEach(this._addPattern, this)\n\n // Some rules have just added to the ignore,\n // making the behavior changed.\n if (this._added) {\n this._initCache()\n }\n\n return this\n }\n\n // legacy\n addPattern (pattern) {\n return this.add(pattern)\n }\n\n // | ignored : unignored\n // negative | 0:0 | 0:1 | 1:0 | 1:1\n // -------- | ------- | ------- | ------- | --------\n // 0 | TEST | TEST | SKIP | X\n // 1 | TESTIF | SKIP | TEST | X\n\n // - SKIP: always skip\n // - TEST: always test\n // - TESTIF: only test if checkUnignored\n // - X: that never happen\n\n // @param {boolean} whether should check if the path is unignored,\n // setting `checkUnignored` to `false` could reduce additional\n // path matching.\n\n // @returns {TestResult} true if a file is ignored\n _testOne (path, checkUnignored) {\n let ignored = false\n let unignored = false\n\n this._rules.forEach(rule => {\n const {negative} = rule\n if (\n unignored === negative && ignored !== unignored\n || negative && !ignored && !unignored && !checkUnignored\n ) {\n return\n }\n\n const matched = rule.regex.test(path)\n\n if (matched) {\n ignored = !negative\n unignored = negative\n }\n })\n\n return {\n ignored,\n unignored\n }\n }\n\n // @returns {TestResult}\n _test (originalPath, cache, checkUnignored, slices) {\n const path = originalPath\n // Supports nullable path\n && checkPath.convert(originalPath)\n\n checkPath(\n path,\n originalPath,\n this._allowRelativePaths\n ? RETURN_FALSE\n : throwError\n )\n\n return this._t(path, cache, checkUnignored, slices)\n }\n\n _t (path, cache, checkUnignored, slices) {\n if (path in cache) {\n return cache[path]\n }\n\n if (!slices) {\n // path/to/a.js\n // ['path', 'to', 'a.js']\n slices = path.split(SLASH)\n }\n\n slices.pop()\n\n // If the path has no parent directory, just test it\n if (!slices.length) {\n return cache[path] = this._testOne(path, checkUnignored)\n }\n\n const parent = this._t(\n slices.join(SLASH) + SLASH,\n cache,\n checkUnignored,\n slices\n )\n\n // If the path contains a parent directory, check the parent first\n return cache[path] = parent.ignored\n // > It is not possible to re-include a file if a parent directory of\n // > that file is excluded.\n ? parent\n : this._testOne(path, checkUnignored)\n }\n\n ignores (path) {\n return this._test(path, this._ignoreCache, false).ignored\n }\n\n createFilter () {\n return path => !this.ignores(path)\n }\n\n filter (paths) {\n return makeArray(paths).filter(this.createFilter())\n }\n\n // @returns {TestResult}\n test (path) {\n return this._test(path, this._testCache, true)\n }\n}\n\nconst factory = options => new Ignore(options)\n\nconst isPathValid = path =>\n checkPath(path && checkPath.convert(path), path, RETURN_FALSE)\n\nfactory.isPathValid = isPathValid\n\n// Fixes typescript\nfactory.default = factory\n\nmodule.exports = factory\n\n// Windows\n// --------------------------------------------------------------\n/* istanbul ignore if */\nif (\n // Detect `process` so that it can run in browsers.\n typeof process !== 'undefined'\n && (\n process.env && process.env.IGNORE_TEST_WIN32\n || process.platform === 'win32'\n )\n) {\n /* eslint no-control-regex: \"off\" */\n const makePosix = str => /^\\\\\\\\\\?\\\\/.test(str)\n || /[\"<>|\\u0000-\\u001F]+/u.test(str)\n ? str\n : str.replace(/\\\\/g, '/')\n\n checkPath.convert = makePosix\n\n // 'C:\\\\foo' <- 'C:\\\\foo' has been converted to 'C:/'\n // 'd:\\\\foo'\n const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\\//i\n checkPath.isNotRelative = path =>\n REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path)\n || isNotRelative(path)\n}\n","const types = {\n 'application/prs.cww': ['cww'],\n 'application/prs.xsf+xml': ['xsf'],\n 'application/vnd.1000minds.decision-model+xml': ['1km'],\n 'application/vnd.3gpp.pic-bw-large': ['plb'],\n 'application/vnd.3gpp.pic-bw-small': ['psb'],\n 'application/vnd.3gpp.pic-bw-var': ['pvb'],\n 'application/vnd.3gpp2.tcap': ['tcap'],\n 'application/vnd.3m.post-it-notes': ['pwn'],\n 'application/vnd.accpac.simply.aso': ['aso'],\n 'application/vnd.accpac.simply.imp': ['imp'],\n 'application/vnd.acucobol': ['acu'],\n 'application/vnd.acucorp': ['atc', 'acutc'],\n 'application/vnd.adobe.air-application-installer-package+zip': ['air'],\n 'application/vnd.adobe.formscentral.fcdt': ['fcdt'],\n 'application/vnd.adobe.fxp': ['fxp', 'fxpl'],\n 'application/vnd.adobe.xdp+xml': ['xdp'],\n 'application/vnd.adobe.xfdf': ['*xfdf'],\n 'application/vnd.age': ['age'],\n 'application/vnd.ahead.space': ['ahead'],\n 'application/vnd.airzip.filesecure.azf': ['azf'],\n 'application/vnd.airzip.filesecure.azs': ['azs'],\n 'application/vnd.amazon.ebook': ['azw'],\n 'application/vnd.americandynamics.acc': ['acc'],\n 'application/vnd.amiga.ami': ['ami'],\n 'application/vnd.android.package-archive': ['apk'],\n 'application/vnd.anser-web-certificate-issue-initiation': ['cii'],\n 'application/vnd.anser-web-funds-transfer-initiation': ['fti'],\n 'application/vnd.antix.game-component': ['atx'],\n 'application/vnd.apple.installer+xml': ['mpkg'],\n 'application/vnd.apple.keynote': ['key'],\n 'application/vnd.apple.mpegurl': ['m3u8'],\n 'application/vnd.apple.numbers': ['numbers'],\n 'application/vnd.apple.pages': ['pages'],\n 'application/vnd.apple.pkpass': ['pkpass'],\n 'application/vnd.aristanetworks.swi': ['swi'],\n 'application/vnd.astraea-software.iota': ['iota'],\n 'application/vnd.audiograph': ['aep'],\n 'application/vnd.autodesk.fbx': ['fbx'],\n 'application/vnd.balsamiq.bmml+xml': ['bmml'],\n 'application/vnd.blueice.multipass': ['mpm'],\n 'application/vnd.bmi': ['bmi'],\n 'application/vnd.businessobjects': ['rep'],\n 'application/vnd.chemdraw+xml': ['cdxml'],\n 'application/vnd.chipnuts.karaoke-mmd': ['mmd'],\n 'application/vnd.cinderella': ['cdy'],\n 'application/vnd.citationstyles.style+xml': ['csl'],\n 'application/vnd.claymore': ['cla'],\n 'application/vnd.cloanto.rp9': ['rp9'],\n 'application/vnd.clonk.c4group': ['c4g', 'c4d', 'c4f', 'c4p', 'c4u'],\n 'application/vnd.cluetrust.cartomobile-config': ['c11amc'],\n 'application/vnd.cluetrust.cartomobile-config-pkg': ['c11amz'],\n 'application/vnd.commonspace': ['csp'],\n 'application/vnd.contact.cmsg': ['cdbcmsg'],\n 'application/vnd.cosmocaller': ['cmc'],\n 'application/vnd.crick.clicker': ['clkx'],\n 'application/vnd.crick.clicker.keyboard': ['clkk'],\n 'application/vnd.crick.clicker.palette': ['clkp'],\n 'application/vnd.crick.clicker.template': ['clkt'],\n 'application/vnd.crick.clicker.wordbank': ['clkw'],\n 'application/vnd.criticaltools.wbs+xml': ['wbs'],\n 'application/vnd.ctc-posml': ['pml'],\n 'application/vnd.cups-ppd': ['ppd'],\n 'application/vnd.curl.car': ['car'],\n 'application/vnd.curl.pcurl': ['pcurl'],\n 'application/vnd.dart': ['dart'],\n 'application/vnd.data-vision.rdz': ['rdz'],\n 'application/vnd.dbf': ['dbf'],\n 'application/vnd.dcmp+xml': ['dcmp'],\n 'application/vnd.dece.data': ['uvf', 'uvvf', 'uvd', 'uvvd'],\n 'application/vnd.dece.ttml+xml': ['uvt', 'uvvt'],\n 'application/vnd.dece.unspecified': ['uvx', 'uvvx'],\n 'application/vnd.dece.zip': ['uvz', 'uvvz'],\n 'application/vnd.denovo.fcselayout-link': ['fe_launch'],\n 'application/vnd.dna': ['dna'],\n 'application/vnd.dolby.mlp': ['mlp'],\n 'application/vnd.dpgraph': ['dpg'],\n 'application/vnd.dreamfactory': ['dfac'],\n 'application/vnd.ds-keypoint': ['kpxx'],\n 'application/vnd.dvb.ait': ['ait'],\n 'application/vnd.dvb.service': ['svc'],\n 'application/vnd.dynageo': ['geo'],\n 'application/vnd.ecowin.chart': ['mag'],\n 'application/vnd.enliven': ['nml'],\n 'application/vnd.epson.esf': ['esf'],\n 'application/vnd.epson.msf': ['msf'],\n 'application/vnd.epson.quickanime': ['qam'],\n 'application/vnd.epson.salt': ['slt'],\n 'application/vnd.epson.ssf': ['ssf'],\n 'application/vnd.eszigno3+xml': ['es3', 'et3'],\n 'application/vnd.ezpix-album': ['ez2'],\n 'application/vnd.ezpix-package': ['ez3'],\n 'application/vnd.fdf': ['*fdf'],\n 'application/vnd.fdsn.mseed': ['mseed'],\n 'application/vnd.fdsn.seed': ['seed', 'dataless'],\n 'application/vnd.flographit': ['gph'],\n 'application/vnd.fluxtime.clip': ['ftc'],\n 'application/vnd.framemaker': ['fm', 'frame', 'maker', 'book'],\n 'application/vnd.frogans.fnc': ['fnc'],\n 'application/vnd.frogans.ltf': ['ltf'],\n 'application/vnd.fsc.weblaunch': ['fsc'],\n 'application/vnd.fujitsu.oasys': ['oas'],\n 'application/vnd.fujitsu.oasys2': ['oa2'],\n 'application/vnd.fujitsu.oasys3': ['oa3'],\n 'application/vnd.fujitsu.oasysgp': ['fg5'],\n 'application/vnd.fujitsu.oasysprs': ['bh2'],\n 'application/vnd.fujixerox.ddd': ['ddd'],\n 'application/vnd.fujixerox.docuworks': ['xdw'],\n 'application/vnd.fujixerox.docuworks.binder': ['xbd'],\n 'application/vnd.fuzzysheet': ['fzs'],\n 'application/vnd.genomatix.tuxedo': ['txd'],\n 'application/vnd.geogebra.file': ['ggb'],\n 'application/vnd.geogebra.slides': ['ggs'],\n 'application/vnd.geogebra.tool': ['ggt'],\n 'application/vnd.geometry-explorer': ['gex', 'gre'],\n 'application/vnd.geonext': ['gxt'],\n 'application/vnd.geoplan': ['g2w'],\n 'application/vnd.geospace': ['g3w'],\n 'application/vnd.gmx': ['gmx'],\n 'application/vnd.google-apps.document': ['gdoc'],\n 'application/vnd.google-apps.drawing': ['gdraw'],\n 'application/vnd.google-apps.form': ['gform'],\n 'application/vnd.google-apps.jam': ['gjam'],\n 'application/vnd.google-apps.map': ['gmap'],\n 'application/vnd.google-apps.presentation': ['gslides'],\n 'application/vnd.google-apps.script': ['gscript'],\n 'application/vnd.google-apps.site': ['gsite'],\n 'application/vnd.google-apps.spreadsheet': ['gsheet'],\n 'application/vnd.google-earth.kml+xml': ['kml'],\n 'application/vnd.google-earth.kmz': ['kmz'],\n 'application/vnd.gov.sk.xmldatacontainer+xml': ['xdcf'],\n 'application/vnd.grafeq': ['gqf', 'gqs'],\n 'application/vnd.groove-account': ['gac'],\n 'application/vnd.groove-help': ['ghf'],\n 'application/vnd.groove-identity-message': ['gim'],\n 'application/vnd.groove-injector': ['grv'],\n 'application/vnd.groove-tool-message': ['gtm'],\n 'application/vnd.groove-tool-template': ['tpl'],\n 'application/vnd.groove-vcard': ['vcg'],\n 'application/vnd.hal+xml': ['hal'],\n 'application/vnd.handheld-entertainment+xml': ['zmm'],\n 'application/vnd.hbci': ['hbci'],\n 'application/vnd.hhe.lesson-player': ['les'],\n 'application/vnd.hp-hpgl': ['hpgl'],\n 'application/vnd.hp-hpid': ['hpid'],\n 'application/vnd.hp-hps': ['hps'],\n 'application/vnd.hp-jlyt': ['jlt'],\n 'application/vnd.hp-pcl': ['pcl'],\n 'application/vnd.hp-pclxl': ['pclxl'],\n 'application/vnd.hydrostatix.sof-data': ['sfd-hdstx'],\n 'application/vnd.ibm.minipay': ['mpy'],\n 'application/vnd.ibm.modcap': ['afp', 'listafp', 'list3820'],\n 'application/vnd.ibm.rights-management': ['irm'],\n 'application/vnd.ibm.secure-container': ['sc'],\n 'application/vnd.iccprofile': ['icc', 'icm'],\n 'application/vnd.igloader': ['igl'],\n 'application/vnd.immervision-ivp': ['ivp'],\n 'application/vnd.immervision-ivu': ['ivu'],\n 'application/vnd.insors.igm': ['igm'],\n 'application/vnd.intercon.formnet': ['xpw', 'xpx'],\n 'application/vnd.intergeo': ['i2g'],\n 'application/vnd.intu.qbo': ['qbo'],\n 'application/vnd.intu.qfx': ['qfx'],\n 'application/vnd.ipunplugged.rcprofile': ['rcprofile'],\n 'application/vnd.irepository.package+xml': ['irp'],\n 'application/vnd.is-xpr': ['xpr'],\n 'application/vnd.isac.fcs': ['fcs'],\n 'application/vnd.jam': ['jam'],\n 'application/vnd.jcp.javame.midlet-rms': ['rms'],\n 'application/vnd.jisp': ['jisp'],\n 'application/vnd.joost.joda-archive': ['joda'],\n 'application/vnd.kahootz': ['ktz', 'ktr'],\n 'application/vnd.kde.karbon': ['karbon'],\n 'application/vnd.kde.kchart': ['chrt'],\n 'application/vnd.kde.kformula': ['kfo'],\n 'application/vnd.kde.kivio': ['flw'],\n 'application/vnd.kde.kontour': ['kon'],\n 'application/vnd.kde.kpresenter': ['kpr', 'kpt'],\n 'application/vnd.kde.kspread': ['ksp'],\n 'application/vnd.kde.kword': ['kwd', 'kwt'],\n 'application/vnd.kenameaapp': ['htke'],\n 'application/vnd.kidspiration': ['kia'],\n 'application/vnd.kinar': ['kne', 'knp'],\n 'application/vnd.koan': ['skp', 'skd', 'skt', 'skm'],\n 'application/vnd.kodak-descriptor': ['sse'],\n 'application/vnd.las.las+xml': ['lasxml'],\n 'application/vnd.llamagraphics.life-balance.desktop': ['lbd'],\n 'application/vnd.llamagraphics.life-balance.exchange+xml': ['lbe'],\n 'application/vnd.lotus-1-2-3': ['123'],\n 'application/vnd.lotus-approach': ['apr'],\n 'application/vnd.lotus-freelance': ['pre'],\n 'application/vnd.lotus-notes': ['nsf'],\n 'application/vnd.lotus-organizer': ['org'],\n 'application/vnd.lotus-screencam': ['scm'],\n 'application/vnd.lotus-wordpro': ['lwp'],\n 'application/vnd.macports.portpkg': ['portpkg'],\n 'application/vnd.mapbox-vector-tile': ['mvt'],\n 'application/vnd.mcd': ['mcd'],\n 'application/vnd.medcalcdata': ['mc1'],\n 'application/vnd.mediastation.cdkey': ['cdkey'],\n 'application/vnd.mfer': ['mwf'],\n 'application/vnd.mfmp': ['mfm'],\n 'application/vnd.micrografx.flo': ['flo'],\n 'application/vnd.micrografx.igx': ['igx'],\n 'application/vnd.mif': ['mif'],\n 'application/vnd.mobius.daf': ['daf'],\n 'application/vnd.mobius.dis': ['dis'],\n 'application/vnd.mobius.mbk': ['mbk'],\n 'application/vnd.mobius.mqy': ['mqy'],\n 'application/vnd.mobius.msl': ['msl'],\n 'application/vnd.mobius.plc': ['plc'],\n 'application/vnd.mobius.txf': ['txf'],\n 'application/vnd.mophun.application': ['mpn'],\n 'application/vnd.mophun.certificate': ['mpc'],\n 'application/vnd.mozilla.xul+xml': ['xul'],\n 'application/vnd.ms-artgalry': ['cil'],\n 'application/vnd.ms-cab-compressed': ['cab'],\n 'application/vnd.ms-excel': ['xls', 'xlm', 'xla', 'xlc', 'xlt', 'xlw'],\n 'application/vnd.ms-excel.addin.macroenabled.12': ['xlam'],\n 'application/vnd.ms-excel.sheet.binary.macroenabled.12': ['xlsb'],\n 'application/vnd.ms-excel.sheet.macroenabled.12': ['xlsm'],\n 'application/vnd.ms-excel.template.macroenabled.12': ['xltm'],\n 'application/vnd.ms-fontobject': ['eot'],\n 'application/vnd.ms-htmlhelp': ['chm'],\n 'application/vnd.ms-ims': ['ims'],\n 'application/vnd.ms-lrm': ['lrm'],\n 'application/vnd.ms-officetheme': ['thmx'],\n 'application/vnd.ms-outlook': ['msg'],\n 'application/vnd.ms-pki.seccat': ['cat'],\n 'application/vnd.ms-pki.stl': ['*stl'],\n 'application/vnd.ms-powerpoint': ['ppt', 'pps', 'pot'],\n 'application/vnd.ms-powerpoint.addin.macroenabled.12': ['ppam'],\n 'application/vnd.ms-powerpoint.presentation.macroenabled.12': ['pptm'],\n 'application/vnd.ms-powerpoint.slide.macroenabled.12': ['sldm'],\n 'application/vnd.ms-powerpoint.slideshow.macroenabled.12': ['ppsm'],\n 'application/vnd.ms-powerpoint.template.macroenabled.12': ['potm'],\n 'application/vnd.ms-project': ['*mpp', 'mpt'],\n 'application/vnd.ms-visio.viewer': ['vdx'],\n 'application/vnd.ms-word.document.macroenabled.12': ['docm'],\n 'application/vnd.ms-word.template.macroenabled.12': ['dotm'],\n 'application/vnd.ms-works': ['wps', 'wks', 'wcm', 'wdb'],\n 'application/vnd.ms-wpl': ['wpl'],\n 'application/vnd.ms-xpsdocument': ['xps'],\n 'application/vnd.mseq': ['mseq'],\n 'application/vnd.musician': ['mus'],\n 'application/vnd.muvee.style': ['msty'],\n 'application/vnd.mynfc': ['taglet'],\n 'application/vnd.nato.bindingdataobject+xml': ['bdo'],\n 'application/vnd.neurolanguage.nlu': ['nlu'],\n 'application/vnd.nitf': ['ntf', 'nitf'],\n 'application/vnd.noblenet-directory': ['nnd'],\n 'application/vnd.noblenet-sealer': ['nns'],\n 'application/vnd.noblenet-web': ['nnw'],\n 'application/vnd.nokia.n-gage.ac+xml': ['*ac'],\n 'application/vnd.nokia.n-gage.data': ['ngdat'],\n 'application/vnd.nokia.n-gage.symbian.install': ['n-gage'],\n 'application/vnd.nokia.radio-preset': ['rpst'],\n 'application/vnd.nokia.radio-presets': ['rpss'],\n 'application/vnd.novadigm.edm': ['edm'],\n 'application/vnd.novadigm.edx': ['edx'],\n 'application/vnd.novadigm.ext': ['ext'],\n 'application/vnd.oasis.opendocument.chart': ['odc'],\n 'application/vnd.oasis.opendocument.chart-template': ['otc'],\n 'application/vnd.oasis.opendocument.database': ['odb'],\n 'application/vnd.oasis.opendocument.formula': ['odf'],\n 'application/vnd.oasis.opendocument.formula-template': ['odft'],\n 'application/vnd.oasis.opendocument.graphics': ['odg'],\n 'application/vnd.oasis.opendocument.graphics-template': ['otg'],\n 'application/vnd.oasis.opendocument.image': ['odi'],\n 'application/vnd.oasis.opendocument.image-template': ['oti'],\n 'application/vnd.oasis.opendocument.presentation': ['odp'],\n 'application/vnd.oasis.opendocument.presentation-template': ['otp'],\n 'application/vnd.oasis.opendocument.spreadsheet': ['ods'],\n 'application/vnd.oasis.opendocument.spreadsheet-template': ['ots'],\n 'application/vnd.oasis.opendocument.text': ['odt'],\n 'application/vnd.oasis.opendocument.text-master': ['odm'],\n 'application/vnd.oasis.opendocument.text-template': ['ott'],\n 'application/vnd.oasis.opendocument.text-web': ['oth'],\n 'application/vnd.olpc-sugar': ['xo'],\n 'application/vnd.oma.dd2+xml': ['dd2'],\n 'application/vnd.openblox.game+xml': ['obgx'],\n 'application/vnd.openofficeorg.extension': ['oxt'],\n 'application/vnd.openstreetmap.data+xml': ['osm'],\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation': [\n 'pptx',\n ],\n 'application/vnd.openxmlformats-officedocument.presentationml.slide': [\n 'sldx',\n ],\n 'application/vnd.openxmlformats-officedocument.presentationml.slideshow': [\n 'ppsx',\n ],\n 'application/vnd.openxmlformats-officedocument.presentationml.template': [\n 'potx',\n ],\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': ['xlsx'],\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.template': [\n 'xltx',\n ],\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': [\n 'docx',\n ],\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.template': [\n 'dotx',\n ],\n 'application/vnd.osgeo.mapguide.package': ['mgp'],\n 'application/vnd.osgi.dp': ['dp'],\n 'application/vnd.osgi.subsystem': ['esa'],\n 'application/vnd.palm': ['pdb', 'pqa', 'oprc'],\n 'application/vnd.pawaafile': ['paw'],\n 'application/vnd.pg.format': ['str'],\n 'application/vnd.pg.osasli': ['ei6'],\n 'application/vnd.picsel': ['efif'],\n 'application/vnd.pmi.widget': ['wg'],\n 'application/vnd.pocketlearn': ['plf'],\n 'application/vnd.powerbuilder6': ['pbd'],\n 'application/vnd.previewsystems.box': ['box'],\n 'application/vnd.procrate.brushset': ['brushset'],\n 'application/vnd.procreate.brush': ['brush'],\n 'application/vnd.procreate.dream': ['drm'],\n 'application/vnd.proteus.magazine': ['mgz'],\n 'application/vnd.publishare-delta-tree': ['qps'],\n 'application/vnd.pvi.ptid1': ['ptid'],\n 'application/vnd.pwg-xhtml-print+xml': ['xhtm'],\n 'application/vnd.quark.quarkxpress': [\n 'qxd',\n 'qxt',\n 'qwd',\n 'qwt',\n 'qxl',\n 'qxb',\n ],\n 'application/vnd.rar': ['rar'],\n 'application/vnd.realvnc.bed': ['bed'],\n 'application/vnd.recordare.musicxml': ['mxl'],\n 'application/vnd.recordare.musicxml+xml': ['musicxml'],\n 'application/vnd.rig.cryptonote': ['cryptonote'],\n 'application/vnd.rim.cod': ['cod'],\n 'application/vnd.rn-realmedia': ['rm'],\n 'application/vnd.rn-realmedia-vbr': ['rmvb'],\n 'application/vnd.route66.link66+xml': ['link66'],\n 'application/vnd.sailingtracker.track': ['st'],\n 'application/vnd.seemail': ['see'],\n 'application/vnd.sema': ['sema'],\n 'application/vnd.semd': ['semd'],\n 'application/vnd.semf': ['semf'],\n 'application/vnd.shana.informed.formdata': ['ifm'],\n 'application/vnd.shana.informed.formtemplate': ['itp'],\n 'application/vnd.shana.informed.interchange': ['iif'],\n 'application/vnd.shana.informed.package': ['ipk'],\n 'application/vnd.simtech-mindmapper': ['twd', 'twds'],\n 'application/vnd.smaf': ['mmf'],\n 'application/vnd.smart.teacher': ['teacher'],\n 'application/vnd.software602.filler.form+xml': ['fo'],\n 'application/vnd.solent.sdkm+xml': ['sdkm', 'sdkd'],\n 'application/vnd.spotfire.dxp': ['dxp'],\n 'application/vnd.spotfire.sfs': ['sfs'],\n 'application/vnd.stardivision.calc': ['sdc'],\n 'application/vnd.stardivision.draw': ['sda'],\n 'application/vnd.stardivision.impress': ['sdd'],\n 'application/vnd.stardivision.math': ['smf'],\n 'application/vnd.stardivision.writer': ['sdw', 'vor'],\n 'application/vnd.stardivision.writer-global': ['sgl'],\n 'application/vnd.stepmania.package': ['smzip'],\n 'application/vnd.stepmania.stepchart': ['sm'],\n 'application/vnd.sun.wadl+xml': ['wadl'],\n 'application/vnd.sun.xml.calc': ['sxc'],\n 'application/vnd.sun.xml.calc.template': ['stc'],\n 'application/vnd.sun.xml.draw': ['sxd'],\n 'application/vnd.sun.xml.draw.template': ['std'],\n 'application/vnd.sun.xml.impress': ['sxi'],\n 'application/vnd.sun.xml.impress.template': ['sti'],\n 'application/vnd.sun.xml.math': ['sxm'],\n 'application/vnd.sun.xml.writer': ['sxw'],\n 'application/vnd.sun.xml.writer.global': ['sxg'],\n 'application/vnd.sun.xml.writer.template': ['stw'],\n 'application/vnd.sus-calendar': ['sus', 'susp'],\n 'application/vnd.svd': ['svd'],\n 'application/vnd.symbian.install': ['sis', 'sisx'],\n 'application/vnd.syncml+xml': ['xsm'],\n 'application/vnd.syncml.dm+wbxml': ['bdm'],\n 'application/vnd.syncml.dm+xml': ['xdm'],\n 'application/vnd.syncml.dmddf+xml': ['ddf'],\n 'application/vnd.tao.intent-module-archive': ['tao'],\n 'application/vnd.tcpdump.pcap': ['pcap', 'cap', 'dmp'],\n 'application/vnd.tmobile-livetv': ['tmo'],\n 'application/vnd.trid.tpt': ['tpt'],\n 'application/vnd.triscape.mxs': ['mxs'],\n 'application/vnd.trueapp': ['tra'],\n 'application/vnd.ufdl': ['ufd', 'ufdl'],\n 'application/vnd.uiq.theme': ['utz'],\n 'application/vnd.umajin': ['umj'],\n 'application/vnd.unity': ['unityweb'],\n 'application/vnd.uoml+xml': ['uoml', 'uo'],\n 'application/vnd.vcx': ['vcx'],\n 'application/vnd.visio': ['vsd', 'vst', 'vss', 'vsw', 'vsdx', 'vtx'],\n 'application/vnd.visionary': ['vis'],\n 'application/vnd.vsf': ['vsf'],\n 'application/vnd.wap.wbxml': ['wbxml'],\n 'application/vnd.wap.wmlc': ['wmlc'],\n 'application/vnd.wap.wmlscriptc': ['wmlsc'],\n 'application/vnd.webturbo': ['wtb'],\n 'application/vnd.wolfram.player': ['nbp'],\n 'application/vnd.wordperfect': ['wpd'],\n 'application/vnd.wqd': ['wqd'],\n 'application/vnd.wt.stf': ['stf'],\n 'application/vnd.xara': ['xar'],\n 'application/vnd.xfdl': ['xfdl'],\n 'application/vnd.yamaha.hv-dic': ['hvd'],\n 'application/vnd.yamaha.hv-script': ['hvs'],\n 'application/vnd.yamaha.hv-voice': ['hvp'],\n 'application/vnd.yamaha.openscoreformat': ['osf'],\n 'application/vnd.yamaha.openscoreformat.osfpvg+xml': ['osfpvg'],\n 'application/vnd.yamaha.smaf-audio': ['saf'],\n 'application/vnd.yamaha.smaf-phrase': ['spf'],\n 'application/vnd.yellowriver-custom-menu': ['cmp'],\n 'application/vnd.zul': ['zir', 'zirz'],\n 'application/vnd.zzazz.deck+xml': ['zaz'],\n 'application/x-7z-compressed': ['7z'],\n 'application/x-abiword': ['abw'],\n 'application/x-ace-compressed': ['ace'],\n 'application/x-apple-diskimage': ['*dmg'],\n 'application/x-arj': ['arj'],\n 'application/x-authorware-bin': ['aab', 'x32', 'u32', 'vox'],\n 'application/x-authorware-map': ['aam'],\n 'application/x-authorware-seg': ['aas'],\n 'application/x-bcpio': ['bcpio'],\n 'application/x-bdoc': ['*bdoc'],\n 'application/x-bittorrent': ['torrent'],\n 'application/x-blender': ['blend'],\n 'application/x-blorb': ['blb', 'blorb'],\n 'application/x-bzip': ['bz'],\n 'application/x-bzip2': ['bz2', 'boz'],\n 'application/x-cbr': ['cbr', 'cba', 'cbt', 'cbz', 'cb7'],\n 'application/x-cdlink': ['vcd'],\n 'application/x-cfs-compressed': ['cfs'],\n 'application/x-chat': ['chat'],\n 'application/x-chess-pgn': ['pgn'],\n 'application/x-chrome-extension': ['crx'],\n 'application/x-cocoa': ['cco'],\n 'application/x-compressed': ['*rar'],\n 'application/x-conference': ['nsc'],\n 'application/x-cpio': ['cpio'],\n 'application/x-csh': ['csh'],\n 'application/x-debian-package': ['*deb', 'udeb'],\n 'application/x-dgc-compressed': ['dgc'],\n 'application/x-director': [\n 'dir',\n 'dcr',\n 'dxr',\n 'cst',\n 'cct',\n 'cxt',\n 'w3d',\n 'fgd',\n 'swa',\n ],\n 'application/x-doom': ['wad'],\n 'application/x-dtbncx+xml': ['ncx'],\n 'application/x-dtbook+xml': ['dtb'],\n 'application/x-dtbresource+xml': ['res'],\n 'application/x-dvi': ['dvi'],\n 'application/x-envoy': ['evy'],\n 'application/x-eva': ['eva'],\n 'application/x-font-bdf': ['bdf'],\n 'application/x-font-ghostscript': ['gsf'],\n 'application/x-font-linux-psf': ['psf'],\n 'application/x-font-pcf': ['pcf'],\n 'application/x-font-snf': ['snf'],\n 'application/x-font-type1': ['pfa', 'pfb', 'pfm', 'afm'],\n 'application/x-freearc': ['arc'],\n 'application/x-futuresplash': ['spl'],\n 'application/x-gca-compressed': ['gca'],\n 'application/x-glulx': ['ulx'],\n 'application/x-gnumeric': ['gnumeric'],\n 'application/x-gramps-xml': ['gramps'],\n 'application/x-gtar': ['gtar'],\n 'application/x-hdf': ['hdf'],\n 'application/x-httpd-php': ['php'],\n 'application/x-install-instructions': ['install'],\n 'application/x-ipynb+json': ['ipynb'],\n 'application/x-iso9660-image': ['*iso'],\n 'application/x-iwork-keynote-sffkey': ['*key'],\n 'application/x-iwork-numbers-sffnumbers': ['*numbers'],\n 'application/x-iwork-pages-sffpages': ['*pages'],\n 'application/x-java-archive-diff': ['jardiff'],\n 'application/x-java-jnlp-file': ['jnlp'],\n 'application/x-keepass2': ['kdbx'],\n 'application/x-latex': ['latex'],\n 'application/x-lua-bytecode': ['luac'],\n 'application/x-lzh-compressed': ['lzh', 'lha'],\n 'application/x-makeself': ['run'],\n 'application/x-mie': ['mie'],\n 'application/x-mobipocket-ebook': ['*prc', 'mobi'],\n 'application/x-ms-application': ['application'],\n 'application/x-ms-shortcut': ['lnk'],\n 'application/x-ms-wmd': ['wmd'],\n 'application/x-ms-wmz': ['wmz'],\n 'application/x-ms-xbap': ['xbap'],\n 'application/x-msaccess': ['mdb'],\n 'application/x-msbinder': ['obd'],\n 'application/x-mscardfile': ['crd'],\n 'application/x-msclip': ['clp'],\n 'application/x-msdos-program': ['*exe'],\n 'application/x-msdownload': ['*exe', '*dll', 'com', 'bat', '*msi'],\n 'application/x-msmediaview': ['mvb', 'm13', 'm14'],\n 'application/x-msmetafile': ['*wmf', '*wmz', '*emf', 'emz'],\n 'application/x-msmoney': ['mny'],\n 'application/x-mspublisher': ['pub'],\n 'application/x-msschedule': ['scd'],\n 'application/x-msterminal': ['trm'],\n 'application/x-mswrite': ['wri'],\n 'application/x-netcdf': ['nc', 'cdf'],\n 'application/x-ns-proxy-autoconfig': ['pac'],\n 'application/x-nzb': ['nzb'],\n 'application/x-perl': ['pl', 'pm'],\n 'application/x-pilot': ['*prc', '*pdb'],\n 'application/x-pkcs12': ['p12', 'pfx'],\n 'application/x-pkcs7-certificates': ['p7b', 'spc'],\n 'application/x-pkcs7-certreqresp': ['p7r'],\n 'application/x-rar-compressed': ['*rar'],\n 'application/x-redhat-package-manager': ['rpm'],\n 'application/x-research-info-systems': ['ris'],\n 'application/x-sea': ['sea'],\n 'application/x-sh': ['sh'],\n 'application/x-shar': ['shar'],\n 'application/x-shockwave-flash': ['swf'],\n 'application/x-silverlight-app': ['xap'],\n 'application/x-sql': ['*sql'],\n 'application/x-stuffit': ['sit'],\n 'application/x-stuffitx': ['sitx'],\n 'application/x-subrip': ['srt'],\n 'application/x-sv4cpio': ['sv4cpio'],\n 'application/x-sv4crc': ['sv4crc'],\n 'application/x-t3vm-image': ['t3'],\n 'application/x-tads': ['gam'],\n 'application/x-tar': ['tar'],\n 'application/x-tcl': ['tcl', 'tk'],\n 'application/x-tex': ['tex'],\n 'application/x-tex-tfm': ['tfm'],\n 'application/x-texinfo': ['texinfo', 'texi'],\n 'application/x-tgif': ['*obj'],\n 'application/x-ustar': ['ustar'],\n 'application/x-virtualbox-hdd': ['hdd'],\n 'application/x-virtualbox-ova': ['ova'],\n 'application/x-virtualbox-ovf': ['ovf'],\n 'application/x-virtualbox-vbox': ['vbox'],\n 'application/x-virtualbox-vbox-extpack': ['vbox-extpack'],\n 'application/x-virtualbox-vdi': ['vdi'],\n 'application/x-virtualbox-vhd': ['vhd'],\n 'application/x-virtualbox-vmdk': ['vmdk'],\n 'application/x-wais-source': ['src'],\n 'application/x-web-app-manifest+json': ['webapp'],\n 'application/x-x509-ca-cert': ['der', 'crt', 'pem'],\n 'application/x-xfig': ['fig'],\n 'application/x-xliff+xml': ['*xlf'],\n 'application/x-xpinstall': ['xpi'],\n 'application/x-xz': ['xz'],\n 'application/x-zip-compressed': ['*zip'],\n 'application/x-zmachine': ['z1', 'z2', 'z3', 'z4', 'z5', 'z6', 'z7', 'z8'],\n 'audio/vnd.dece.audio': ['uva', 'uvva'],\n 'audio/vnd.digital-winds': ['eol'],\n 'audio/vnd.dra': ['dra'],\n 'audio/vnd.dts': ['dts'],\n 'audio/vnd.dts.hd': ['dtshd'],\n 'audio/vnd.lucent.voice': ['lvp'],\n 'audio/vnd.ms-playready.media.pya': ['pya'],\n 'audio/vnd.nuera.ecelp4800': ['ecelp4800'],\n 'audio/vnd.nuera.ecelp7470': ['ecelp7470'],\n 'audio/vnd.nuera.ecelp9600': ['ecelp9600'],\n 'audio/vnd.rip': ['rip'],\n 'audio/x-aac': ['*aac'],\n 'audio/x-aiff': ['aif', 'aiff', 'aifc'],\n 'audio/x-caf': ['caf'],\n 'audio/x-flac': ['flac'],\n 'audio/x-m4a': ['*m4a'],\n 'audio/x-matroska': ['mka'],\n 'audio/x-mpegurl': ['m3u'],\n 'audio/x-ms-wax': ['wax'],\n 'audio/x-ms-wma': ['wma'],\n 'audio/x-pn-realaudio': ['ram', 'ra'],\n 'audio/x-pn-realaudio-plugin': ['rmp'],\n 'audio/x-realaudio': ['*ra'],\n 'audio/x-wav': ['*wav'],\n 'chemical/x-cdx': ['cdx'],\n 'chemical/x-cif': ['cif'],\n 'chemical/x-cmdf': ['cmdf'],\n 'chemical/x-cml': ['cml'],\n 'chemical/x-csml': ['csml'],\n 'chemical/x-xyz': ['xyz'],\n 'image/prs.btif': ['btif', 'btf'],\n 'image/prs.pti': ['pti'],\n 'image/vnd.adobe.photoshop': ['psd'],\n 'image/vnd.airzip.accelerator.azv': ['azv'],\n 'image/vnd.blockfact.facti': ['facti'],\n 'image/vnd.dece.graphic': ['uvi', 'uvvi', 'uvg', 'uvvg'],\n 'image/vnd.djvu': ['djvu', 'djv'],\n 'image/vnd.dvb.subtitle': ['*sub'],\n 'image/vnd.dwg': ['dwg'],\n 'image/vnd.dxf': ['dxf'],\n 'image/vnd.fastbidsheet': ['fbs'],\n 'image/vnd.fpx': ['fpx'],\n 'image/vnd.fst': ['fst'],\n 'image/vnd.fujixerox.edmics-mmr': ['mmr'],\n 'image/vnd.fujixerox.edmics-rlc': ['rlc'],\n 'image/vnd.microsoft.icon': ['ico'],\n 'image/vnd.ms-dds': ['dds'],\n 'image/vnd.ms-modi': ['mdi'],\n 'image/vnd.ms-photo': ['wdp'],\n 'image/vnd.net-fpx': ['npx'],\n 'image/vnd.pco.b16': ['b16'],\n 'image/vnd.tencent.tap': ['tap'],\n 'image/vnd.valve.source.texture': ['vtf'],\n 'image/vnd.wap.wbmp': ['wbmp'],\n 'image/vnd.xiff': ['xif'],\n 'image/vnd.zbrush.pcx': ['pcx'],\n 'image/x-3ds': ['3ds'],\n 'image/x-adobe-dng': ['dng'],\n 'image/x-cmu-raster': ['ras'],\n 'image/x-cmx': ['cmx'],\n 'image/x-freehand': ['fh', 'fhc', 'fh4', 'fh5', 'fh7'],\n 'image/x-icon': ['*ico'],\n 'image/x-jng': ['jng'],\n 'image/x-mrsid-image': ['sid'],\n 'image/x-ms-bmp': ['*bmp'],\n 'image/x-pcx': ['*pcx'],\n 'image/x-pict': ['pic', 'pct'],\n 'image/x-portable-anymap': ['pnm'],\n 'image/x-portable-bitmap': ['pbm'],\n 'image/x-portable-graymap': ['pgm'],\n 'image/x-portable-pixmap': ['ppm'],\n 'image/x-rgb': ['rgb'],\n 'image/x-tga': ['tga'],\n 'image/x-xbitmap': ['xbm'],\n 'image/x-xpixmap': ['xpm'],\n 'image/x-xwindowdump': ['xwd'],\n 'message/vnd.wfa.wsc': ['wsc'],\n 'model/vnd.bary': ['bary'],\n 'model/vnd.cld': ['cld'],\n 'model/vnd.collada+xml': ['dae'],\n 'model/vnd.dwf': ['dwf'],\n 'model/vnd.gdl': ['gdl'],\n 'model/vnd.gtw': ['gtw'],\n 'model/vnd.mts': ['*mts'],\n 'model/vnd.opengex': ['ogex'],\n 'model/vnd.parasolid.transmit.binary': ['x_b'],\n 'model/vnd.parasolid.transmit.text': ['x_t'],\n 'model/vnd.pytha.pyox': ['pyo', 'pyox'],\n 'model/vnd.sap.vds': ['vds'],\n 'model/vnd.usda': ['usda'],\n 'model/vnd.usdz+zip': ['usdz'],\n 'model/vnd.valve.source.compiled-map': ['bsp'],\n 'model/vnd.vtu': ['vtu'],\n 'text/prs.lines.tag': ['dsc'],\n 'text/vnd.curl': ['curl'],\n 'text/vnd.curl.dcurl': ['dcurl'],\n 'text/vnd.curl.mcurl': ['mcurl'],\n 'text/vnd.curl.scurl': ['scurl'],\n 'text/vnd.dvb.subtitle': ['sub'],\n 'text/vnd.familysearch.gedcom': ['ged'],\n 'text/vnd.fly': ['fly'],\n 'text/vnd.fmi.flexstor': ['flx'],\n 'text/vnd.graphviz': ['gv'],\n 'text/vnd.in3d.3dml': ['3dml'],\n 'text/vnd.in3d.spot': ['spot'],\n 'text/vnd.sun.j2me.app-descriptor': ['jad'],\n 'text/vnd.wap.wml': ['wml'],\n 'text/vnd.wap.wmlscript': ['wmls'],\n 'text/x-asm': ['s', 'asm'],\n 'text/x-c': ['c', 'cc', 'cxx', 'cpp', 'h', 'hh', 'dic'],\n 'text/x-component': ['htc'],\n 'text/x-fortran': ['f', 'for', 'f77', 'f90'],\n 'text/x-handlebars-template': ['hbs'],\n 'text/x-java-source': ['java'],\n 'text/x-lua': ['lua'],\n 'text/x-markdown': ['mkd'],\n 'text/x-nfo': ['nfo'],\n 'text/x-opml': ['opml'],\n 'text/x-org': ['*org'],\n 'text/x-pascal': ['p', 'pas'],\n 'text/x-processing': ['pde'],\n 'text/x-sass': ['sass'],\n 'text/x-scss': ['scss'],\n 'text/x-setext': ['etx'],\n 'text/x-sfv': ['sfv'],\n 'text/x-suse-ymp': ['ymp'],\n 'text/x-uuencode': ['uu'],\n 'text/x-vcalendar': ['vcs'],\n 'text/x-vcard': ['vcf'],\n 'video/vnd.dece.hd': ['uvh', 'uvvh'],\n 'video/vnd.dece.mobile': ['uvm', 'uvvm'],\n 'video/vnd.dece.pd': ['uvp', 'uvvp'],\n 'video/vnd.dece.sd': ['uvs', 'uvvs'],\n 'video/vnd.dece.video': ['uvv', 'uvvv'],\n 'video/vnd.dvb.file': ['dvb'],\n 'video/vnd.fvt': ['fvt'],\n 'video/vnd.mpegurl': ['mxu', 'm4u'],\n 'video/vnd.ms-playready.media.pyv': ['pyv'],\n 'video/vnd.uvvu.mp4': ['uvu', 'uvvu'],\n 'video/vnd.vivo': ['viv'],\n 'video/x-f4v': ['f4v'],\n 'video/x-fli': ['fli'],\n 'video/x-flv': ['flv'],\n 'video/x-m4v': ['m4v'],\n 'video/x-matroska': ['mkv', 'mk3d', 'mks'],\n 'video/x-mng': ['mng'],\n 'video/x-ms-asf': ['asf', 'asx'],\n 'video/x-ms-vob': ['vob'],\n 'video/x-ms-wm': ['wm'],\n 'video/x-ms-wmv': ['wmv'],\n 'video/x-ms-wmx': ['wmx'],\n 'video/x-ms-wvx': ['wvx'],\n 'video/x-msvideo': ['avi'],\n 'video/x-sgi-movie': ['movie'],\n 'video/x-smv': ['smv'],\n 'x-conference/x-cooltalk': ['ice'],\n};\nObject.freeze(types);\nexport default types;\n","const types = {\n 'application/andrew-inset': ['ez'],\n 'application/appinstaller': ['appinstaller'],\n 'application/applixware': ['aw'],\n 'application/appx': ['appx'],\n 'application/appxbundle': ['appxbundle'],\n 'application/atom+xml': ['atom'],\n 'application/atomcat+xml': ['atomcat'],\n 'application/atomdeleted+xml': ['atomdeleted'],\n 'application/atomsvc+xml': ['atomsvc'],\n 'application/atsc-dwd+xml': ['dwd'],\n 'application/atsc-held+xml': ['held'],\n 'application/atsc-rsat+xml': ['rsat'],\n 'application/automationml-aml+xml': ['aml'],\n 'application/automationml-amlx+zip': ['amlx'],\n 'application/bdoc': ['bdoc'],\n 'application/calendar+xml': ['xcs'],\n 'application/ccxml+xml': ['ccxml'],\n 'application/cdfx+xml': ['cdfx'],\n 'application/cdmi-capability': ['cdmia'],\n 'application/cdmi-container': ['cdmic'],\n 'application/cdmi-domain': ['cdmid'],\n 'application/cdmi-object': ['cdmio'],\n 'application/cdmi-queue': ['cdmiq'],\n 'application/cpl+xml': ['cpl'],\n 'application/cu-seeme': ['cu'],\n 'application/cwl': ['cwl'],\n 'application/dash+xml': ['mpd'],\n 'application/dash-patch+xml': ['mpp'],\n 'application/davmount+xml': ['davmount'],\n 'application/dicom': ['dcm'],\n 'application/docbook+xml': ['dbk'],\n 'application/dssc+der': ['dssc'],\n 'application/dssc+xml': ['xdssc'],\n 'application/ecmascript': ['ecma'],\n 'application/emma+xml': ['emma'],\n 'application/emotionml+xml': ['emotionml'],\n 'application/epub+zip': ['epub'],\n 'application/exi': ['exi'],\n 'application/express': ['exp'],\n 'application/fdf': ['fdf'],\n 'application/fdt+xml': ['fdt'],\n 'application/font-tdpfr': ['pfr'],\n 'application/geo+json': ['geojson'],\n 'application/gml+xml': ['gml'],\n 'application/gpx+xml': ['gpx'],\n 'application/gxf': ['gxf'],\n 'application/gzip': ['gz'],\n 'application/hjson': ['hjson'],\n 'application/hyperstudio': ['stk'],\n 'application/inkml+xml': ['ink', 'inkml'],\n 'application/ipfix': ['ipfix'],\n 'application/its+xml': ['its'],\n 'application/java-archive': ['jar', 'war', 'ear'],\n 'application/java-serialized-object': ['ser'],\n 'application/java-vm': ['class'],\n 'application/javascript': ['*js'],\n 'application/json': ['json', 'map'],\n 'application/json5': ['json5'],\n 'application/jsonml+json': ['jsonml'],\n 'application/ld+json': ['jsonld'],\n 'application/lgr+xml': ['lgr'],\n 'application/lost+xml': ['lostxml'],\n 'application/mac-binhex40': ['hqx'],\n 'application/mac-compactpro': ['cpt'],\n 'application/mads+xml': ['mads'],\n 'application/manifest+json': ['webmanifest'],\n 'application/marc': ['mrc'],\n 'application/marcxml+xml': ['mrcx'],\n 'application/mathematica': ['ma', 'nb', 'mb'],\n 'application/mathml+xml': ['mathml'],\n 'application/mbox': ['mbox'],\n 'application/media-policy-dataset+xml': ['mpf'],\n 'application/mediaservercontrol+xml': ['mscml'],\n 'application/metalink+xml': ['metalink'],\n 'application/metalink4+xml': ['meta4'],\n 'application/mets+xml': ['mets'],\n 'application/mmt-aei+xml': ['maei'],\n 'application/mmt-usd+xml': ['musd'],\n 'application/mods+xml': ['mods'],\n 'application/mp21': ['m21', 'mp21'],\n 'application/mp4': ['*mp4', '*mpg4', 'mp4s', 'm4p'],\n 'application/msix': ['msix'],\n 'application/msixbundle': ['msixbundle'],\n 'application/msword': ['doc', 'dot'],\n 'application/mxf': ['mxf'],\n 'application/n-quads': ['nq'],\n 'application/n-triples': ['nt'],\n 'application/node': ['cjs'],\n 'application/octet-stream': [\n 'bin',\n 'dms',\n 'lrf',\n 'mar',\n 'so',\n 'dist',\n 'distz',\n 'pkg',\n 'bpk',\n 'dump',\n 'elc',\n 'deploy',\n 'exe',\n 'dll',\n 'deb',\n 'dmg',\n 'iso',\n 'img',\n 'msi',\n 'msp',\n 'msm',\n 'buffer',\n ],\n 'application/oda': ['oda'],\n 'application/oebps-package+xml': ['opf'],\n 'application/ogg': ['ogx'],\n 'application/omdoc+xml': ['omdoc'],\n 'application/onenote': [\n 'onetoc',\n 'onetoc2',\n 'onetmp',\n 'onepkg',\n 'one',\n 'onea',\n ],\n 'application/oxps': ['oxps'],\n 'application/p2p-overlay+xml': ['relo'],\n 'application/patch-ops-error+xml': ['xer'],\n 'application/pdf': ['pdf'],\n 'application/pgp-encrypted': ['pgp'],\n 'application/pgp-keys': ['asc'],\n 'application/pgp-signature': ['sig', '*asc'],\n 'application/pics-rules': ['prf'],\n 'application/pkcs10': ['p10'],\n 'application/pkcs7-mime': ['p7m', 'p7c'],\n 'application/pkcs7-signature': ['p7s'],\n 'application/pkcs8': ['p8'],\n 'application/pkix-attr-cert': ['ac'],\n 'application/pkix-cert': ['cer'],\n 'application/pkix-crl': ['crl'],\n 'application/pkix-pkipath': ['pkipath'],\n 'application/pkixcmp': ['pki'],\n 'application/pls+xml': ['pls'],\n 'application/postscript': ['ai', 'eps', 'ps'],\n 'application/provenance+xml': ['provx'],\n 'application/pskc+xml': ['pskcxml'],\n 'application/raml+yaml': ['raml'],\n 'application/rdf+xml': ['rdf', 'owl'],\n 'application/reginfo+xml': ['rif'],\n 'application/relax-ng-compact-syntax': ['rnc'],\n 'application/resource-lists+xml': ['rl'],\n 'application/resource-lists-diff+xml': ['rld'],\n 'application/rls-services+xml': ['rs'],\n 'application/route-apd+xml': ['rapd'],\n 'application/route-s-tsid+xml': ['sls'],\n 'application/route-usd+xml': ['rusd'],\n 'application/rpki-ghostbusters': ['gbr'],\n 'application/rpki-manifest': ['mft'],\n 'application/rpki-roa': ['roa'],\n 'application/rsd+xml': ['rsd'],\n 'application/rss+xml': ['rss'],\n 'application/rtf': ['rtf'],\n 'application/sbml+xml': ['sbml'],\n 'application/scvp-cv-request': ['scq'],\n 'application/scvp-cv-response': ['scs'],\n 'application/scvp-vp-request': ['spq'],\n 'application/scvp-vp-response': ['spp'],\n 'application/sdp': ['sdp'],\n 'application/senml+xml': ['senmlx'],\n 'application/sensml+xml': ['sensmlx'],\n 'application/set-payment-initiation': ['setpay'],\n 'application/set-registration-initiation': ['setreg'],\n 'application/shf+xml': ['shf'],\n 'application/sieve': ['siv', 'sieve'],\n 'application/smil+xml': ['smi', 'smil'],\n 'application/sparql-query': ['rq'],\n 'application/sparql-results+xml': ['srx'],\n 'application/sql': ['sql'],\n 'application/srgs': ['gram'],\n 'application/srgs+xml': ['grxml'],\n 'application/sru+xml': ['sru'],\n 'application/ssdl+xml': ['ssdl'],\n 'application/ssml+xml': ['ssml'],\n 'application/swid+xml': ['swidtag'],\n 'application/tei+xml': ['tei', 'teicorpus'],\n 'application/thraud+xml': ['tfi'],\n 'application/timestamped-data': ['tsd'],\n 'application/toml': ['toml'],\n 'application/trig': ['trig'],\n 'application/ttml+xml': ['ttml'],\n 'application/ubjson': ['ubj'],\n 'application/urc-ressheet+xml': ['rsheet'],\n 'application/urc-targetdesc+xml': ['td'],\n 'application/voicexml+xml': ['vxml'],\n 'application/wasm': ['wasm'],\n 'application/watcherinfo+xml': ['wif'],\n 'application/widget': ['wgt'],\n 'application/winhlp': ['hlp'],\n 'application/wsdl+xml': ['wsdl'],\n 'application/wspolicy+xml': ['wspolicy'],\n 'application/xaml+xml': ['xaml'],\n 'application/xcap-att+xml': ['xav'],\n 'application/xcap-caps+xml': ['xca'],\n 'application/xcap-diff+xml': ['xdf'],\n 'application/xcap-el+xml': ['xel'],\n 'application/xcap-ns+xml': ['xns'],\n 'application/xenc+xml': ['xenc'],\n 'application/xfdf': ['xfdf'],\n 'application/xhtml+xml': ['xhtml', 'xht'],\n 'application/xliff+xml': ['xlf'],\n 'application/xml': ['xml', 'xsl', 'xsd', 'rng'],\n 'application/xml-dtd': ['dtd'],\n 'application/xop+xml': ['xop'],\n 'application/xproc+xml': ['xpl'],\n 'application/xslt+xml': ['*xsl', 'xslt'],\n 'application/xspf+xml': ['xspf'],\n 'application/xv+xml': ['mxml', 'xhvml', 'xvml', 'xvm'],\n 'application/yang': ['yang'],\n 'application/yin+xml': ['yin'],\n 'application/zip': ['zip'],\n 'application/zip+dotlottie': ['lottie'],\n 'audio/3gpp': ['*3gpp'],\n 'audio/aac': ['adts', 'aac'],\n 'audio/adpcm': ['adp'],\n 'audio/amr': ['amr'],\n 'audio/basic': ['au', 'snd'],\n 'audio/midi': ['mid', 'midi', 'kar', 'rmi'],\n 'audio/mobile-xmf': ['mxmf'],\n 'audio/mp3': ['*mp3'],\n 'audio/mp4': ['m4a', 'mp4a', 'm4b'],\n 'audio/mpeg': ['mpga', 'mp2', 'mp2a', 'mp3', 'm2a', 'm3a'],\n 'audio/ogg': ['oga', 'ogg', 'spx', 'opus'],\n 'audio/s3m': ['s3m'],\n 'audio/silk': ['sil'],\n 'audio/wav': ['wav'],\n 'audio/wave': ['*wav'],\n 'audio/webm': ['weba'],\n 'audio/xm': ['xm'],\n 'font/collection': ['ttc'],\n 'font/otf': ['otf'],\n 'font/ttf': ['ttf'],\n 'font/woff': ['woff'],\n 'font/woff2': ['woff2'],\n 'image/aces': ['exr'],\n 'image/apng': ['apng'],\n 'image/avci': ['avci'],\n 'image/avcs': ['avcs'],\n 'image/avif': ['avif'],\n 'image/bmp': ['bmp', 'dib'],\n 'image/cgm': ['cgm'],\n 'image/dicom-rle': ['drle'],\n 'image/dpx': ['dpx'],\n 'image/emf': ['emf'],\n 'image/fits': ['fits'],\n 'image/g3fax': ['g3'],\n 'image/gif': ['gif'],\n 'image/heic': ['heic'],\n 'image/heic-sequence': ['heics'],\n 'image/heif': ['heif'],\n 'image/heif-sequence': ['heifs'],\n 'image/hej2k': ['hej2'],\n 'image/ief': ['ief'],\n 'image/jaii': ['jaii'],\n 'image/jais': ['jais'],\n 'image/jls': ['jls'],\n 'image/jp2': ['jp2', 'jpg2'],\n 'image/jpeg': ['jpg', 'jpeg', 'jpe'],\n 'image/jph': ['jph'],\n 'image/jphc': ['jhc'],\n 'image/jpm': ['jpm', 'jpgm'],\n 'image/jpx': ['jpx', 'jpf'],\n 'image/jxl': ['jxl'],\n 'image/jxr': ['jxr'],\n 'image/jxra': ['jxra'],\n 'image/jxrs': ['jxrs'],\n 'image/jxs': ['jxs'],\n 'image/jxsc': ['jxsc'],\n 'image/jxsi': ['jxsi'],\n 'image/jxss': ['jxss'],\n 'image/ktx': ['ktx'],\n 'image/ktx2': ['ktx2'],\n 'image/pjpeg': ['jfif'],\n 'image/png': ['png'],\n 'image/sgi': ['sgi'],\n 'image/svg+xml': ['svg', 'svgz'],\n 'image/t38': ['t38'],\n 'image/tiff': ['tif', 'tiff'],\n 'image/tiff-fx': ['tfx'],\n 'image/webp': ['webp'],\n 'image/wmf': ['wmf'],\n 'message/disposition-notification': ['disposition-notification'],\n 'message/global': ['u8msg'],\n 'message/global-delivery-status': ['u8dsn'],\n 'message/global-disposition-notification': ['u8mdn'],\n 'message/global-headers': ['u8hdr'],\n 'message/rfc822': ['eml', 'mime', 'mht', 'mhtml'],\n 'model/3mf': ['3mf'],\n 'model/gltf+json': ['gltf'],\n 'model/gltf-binary': ['glb'],\n 'model/iges': ['igs', 'iges'],\n 'model/jt': ['jt'],\n 'model/mesh': ['msh', 'mesh', 'silo'],\n 'model/mtl': ['mtl'],\n 'model/obj': ['obj'],\n 'model/prc': ['prc'],\n 'model/step': ['step', 'stp', 'stpnc', 'p21', '210'],\n 'model/step+xml': ['stpx'],\n 'model/step+zip': ['stpz'],\n 'model/step-xml+zip': ['stpxz'],\n 'model/stl': ['stl'],\n 'model/u3d': ['u3d'],\n 'model/vrml': ['wrl', 'vrml'],\n 'model/x3d+binary': ['*x3db', 'x3dbz'],\n 'model/x3d+fastinfoset': ['x3db'],\n 'model/x3d+vrml': ['*x3dv', 'x3dvz'],\n 'model/x3d+xml': ['x3d', 'x3dz'],\n 'model/x3d-vrml': ['x3dv'],\n 'text/cache-manifest': ['appcache', 'manifest'],\n 'text/calendar': ['ics', 'ifb'],\n 'text/coffeescript': ['coffee', 'litcoffee'],\n 'text/css': ['css'],\n 'text/csv': ['csv'],\n 'text/html': ['html', 'htm', 'shtml'],\n 'text/jade': ['jade'],\n 'text/javascript': ['js', 'mjs'],\n 'text/jsx': ['jsx'],\n 'text/less': ['less'],\n 'text/markdown': ['md', 'markdown'],\n 'text/mathml': ['mml'],\n 'text/mdx': ['mdx'],\n 'text/n3': ['n3'],\n 'text/plain': ['txt', 'text', 'conf', 'def', 'list', 'log', 'in', 'ini'],\n 'text/richtext': ['rtx'],\n 'text/rtf': ['*rtf'],\n 'text/sgml': ['sgml', 'sgm'],\n 'text/shex': ['shex'],\n 'text/slim': ['slim', 'slm'],\n 'text/spdx': ['spdx'],\n 'text/stylus': ['stylus', 'styl'],\n 'text/tab-separated-values': ['tsv'],\n 'text/troff': ['t', 'tr', 'roff', 'man', 'me', 'ms'],\n 'text/turtle': ['ttl'],\n 'text/uri-list': ['uri', 'uris', 'urls'],\n 'text/vcard': ['vcard'],\n 'text/vtt': ['vtt'],\n 'text/wgsl': ['wgsl'],\n 'text/xml': ['*xml'],\n 'text/yaml': ['yaml', 'yml'],\n 'video/3gpp': ['3gp', '3gpp'],\n 'video/3gpp2': ['3g2'],\n 'video/h261': ['h261'],\n 'video/h263': ['h263'],\n 'video/h264': ['h264'],\n 'video/iso.segment': ['m4s'],\n 'video/jpeg': ['jpgv'],\n 'video/jpm': ['*jpm', '*jpgm'],\n 'video/mj2': ['mj2', 'mjp2'],\n 'video/mp2t': ['ts', 'm2t', 'm2ts', 'mts'],\n 'video/mp4': ['mp4', 'mp4v', 'mpg4'],\n 'video/mpeg': ['mpeg', 'mpg', 'mpe', 'm1v', 'm2v'],\n 'video/ogg': ['ogv'],\n 'video/quicktime': ['qt', 'mov'],\n 'video/webm': ['webm'],\n};\nObject.freeze(types);\nexport default types;\n","var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _Mime_extensionToType, _Mime_typeToExtension, _Mime_typeToExtensions;\nclass Mime {\n constructor(...args) {\n _Mime_extensionToType.set(this, new Map());\n _Mime_typeToExtension.set(this, new Map());\n _Mime_typeToExtensions.set(this, new Map());\n for (const arg of args) {\n this.define(arg);\n }\n }\n define(typeMap, force = false) {\n for (let [type, extensions] of Object.entries(typeMap)) {\n type = type.toLowerCase();\n extensions = extensions.map((ext) => ext.toLowerCase());\n let allExtensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type);\n if (!allExtensions) {\n allExtensions = new Set();\n __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").set(type, allExtensions);\n }\n let first = true;\n for (let extension of extensions) {\n const starred = extension.startsWith('*');\n extension = starred ? extension.slice(1) : extension;\n allExtensions.add(extension);\n if (first) {\n __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").set(type, extension);\n }\n first = false;\n if (starred)\n continue;\n const currentType = __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(extension);\n if (currentType && currentType != type && !force) {\n throw new Error(`\"${type} -> ${extension}\" conflicts with \"${currentType} -> ${extension}\". Pass \\`force=true\\` to override this definition.`);\n }\n __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").set(extension, type);\n }\n }\n return this;\n }\n getType(path) {\n if (typeof path !== 'string')\n return null;\n const last = path.replace(/^.*[/\\\\]/s, '').toLowerCase();\n const ext = last.replace(/^.*\\./s, '').toLowerCase();\n const hasPath = last.length < path.length;\n const hasDot = ext.length < last.length - 1;\n if (!hasDot && hasPath)\n return null;\n return __classPrivateFieldGet(this, _Mime_extensionToType, \"f\").get(ext) ?? null;\n }\n getExtension(type) {\n if (typeof type !== 'string')\n return null;\n type = type?.split?.(';')[0];\n return ((type && __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\").get(type.trim().toLowerCase())) ?? null);\n }\n getAllExtensions(type) {\n if (typeof type !== 'string')\n return null;\n type = type.split(';')[0].trim().toLowerCase();\n const extensions = __classPrivateFieldGet(this, _Mime_typeToExtensions, \"f\").get(type);\n return extensions ? new Set(extensions) : null;\n }\n _freeze() {\n this.define = () => {\n throw new Error('define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances');\n };\n Object.freeze(this);\n return this;\n }\n _getTestState() {\n return {\n types: __classPrivateFieldGet(this, _Mime_extensionToType, \"f\"),\n extensions: __classPrivateFieldGet(this, _Mime_typeToExtension, \"f\"),\n };\n }\n}\n_Mime_extensionToType = new WeakMap(), _Mime_typeToExtension = new WeakMap(), _Mime_typeToExtensions = new WeakMap();\nexport default Mime;\n","import otherTypes from '../types/other.js';\nimport standardTypes from '../types/standard.js';\nimport Mime from './Mime.js';\nexport { default as Mime } from './Mime.js';\nexport default new Mime(standardTypes, otherTypes)._freeze();\n","import { readFileSync } from \"node:fs\";\nimport { isAbsolute, resolve, sep } from \"node:path\";\nimport { TextDecoder } from \"node:util\";\nimport ignore from \"ignore\";\nimport mime from \"mime\";\nimport {\n\tCF_ASSETS_IGNORE_FILENAME,\n\tHEADERS_FILENAME,\n\tREDIRECTS_FILENAME,\n} from \"./constants\";\nimport type { PathOrFileDescriptor } from \"node:fs\";\n\n/** normalises sep for windows and prefix with `/` */\nexport const normalizeFilePath = (relativeFilepath: string) => {\n\tif (isAbsolute(relativeFilepath)) {\n\t\tthrow new Error(`Expected relative path`);\n\t}\n\treturn \"/\" + relativeFilepath.split(sep).join(\"/\");\n};\n\nexport const getContentType = (absFilePath: string) => {\n\tlet contentType = mime.getType(absFilePath);\n\tif (\n\t\tcontentType &&\n\t\tcontentType.startsWith(\"text/\") &&\n\t\t!contentType.includes(\"charset\")\n\t) {\n\t\tcontentType = `${contentType}; charset=utf-8`;\n\t}\n\treturn contentType;\n};\n\n/**\n * Generate a function that can match relative filepaths against a list of gitignore formatted patterns.\n */\nexport function createPatternMatcher(\n\tpatterns: string[],\n\texclude: boolean\n): (filePath: string) => boolean {\n\tif (patterns.length === 0) {\n\t\treturn (_filePath) => !exclude;\n\t} else {\n\t\tconst ignorer = ignore().add(patterns);\n\t\treturn (filePath) => ignorer.test(filePath).ignored;\n\t}\n}\n\nexport function thrownIsDoesNotExistError(\n\tthrown: unknown\n): thrown is Error & { code: \"ENOENT\" } {\n\treturn (\n\t\tthrown instanceof Error && \"code\" in thrown && thrown.code === \"ENOENT\"\n\t);\n}\n\nexport function maybeGetFile(filePath: PathOrFileDescriptor) {\n\ttry {\n\t\treturn readFileSync(filePath, \"utf8\");\n\t} catch (e: unknown) {\n\t\tif (!thrownIsDoesNotExistError(e)) {\n\t\t\tthrow e;\n\t\t}\n\t}\n}\n\n/** An ignore file whose encoding cannot be used to match asset paths. */\nexport class InvalidAssetsIgnoreError extends Error {\n\tconstructor(filePath: string) {\n\t\tsuper(\n\t\t\t`The .assetsignore file at \"${filePath}\" must be UTF-8 encoded and must not contain null characters. Save the file as UTF-8 and try again.`\n\t\t);\n\t\tthis.name = \"InvalidAssetsIgnoreError\";\n\t}\n}\n\n/** Read ignore patterns without silently replacing undecodable characters. */\nfunction readAssetsIgnoreFile(filePath: string): string | undefined {\n\tlet contents: Buffer;\n\ttry {\n\t\tcontents = readFileSync(filePath);\n\t} catch (error) {\n\t\tif (thrownIsDoesNotExistError(error)) {\n\t\t\treturn;\n\t\t}\n\t\tthrow error;\n\t}\n\n\ttry {\n\t\tconst text = new TextDecoder(\"utf-8\", { fatal: true }).decode(contents);\n\t\t// BOM-less UTF-16 can be valid UTF-8 bytes but cannot form usable patterns.\n\t\tif (text.includes(\"\\0\")) {\n\t\t\tthrow new Error(\"Ignore patterns contain a null character.\");\n\t\t}\n\t\treturn text;\n\t} catch {\n\t\tthrow new InvalidAssetsIgnoreError(filePath);\n\t}\n}\n\n/**\n * Create a function for filtering out ignored assets.\n *\n * The generated function takes an asset path, relative to the asset directory,\n * and returns true if the asset should not be ignored.\n */\nexport async function createAssetsIgnoreFunction(dir: string) {\n\tconst cfAssetIgnorePath = resolve(dir, CF_ASSETS_IGNORE_FILENAME);\n\n\tconst ignorePatterns = [\n\t\t// Ignore the `.assetsignore` file and other metafiles by default.\n\t\t// The ignore lib expects unix-style paths for its patterns\n\t\t`/${CF_ASSETS_IGNORE_FILENAME}`,\n\t\t`/${REDIRECTS_FILENAME}`,\n\t\t`/${HEADERS_FILENAME}`,\n\t];\n\n\tlet assetsIgnoreFilePresent = false;\n\tconst assetsIgnore = readAssetsIgnoreFile(cfAssetIgnorePath);\n\tif (assetsIgnore !== undefined) {\n\t\tassetsIgnoreFilePresent = true;\n\t\tignorePatterns.push(...assetsIgnore.split(\"\\n\"));\n\t}\n\n\treturn {\n\t\tassetsIgnoreFunction: createPatternMatcher(ignorePatterns, true),\n\t\tassetsIgnoreFilePresent,\n\t};\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\nimport { miniflare } from './miniflare.js';\nimport { constructHeaders, constructRedirects } from '../workers-sdk/packages/workers-shared/utils/configuration/constructConfiguration.js';\nimport { parseHeaders } from '../workers-sdk/packages/workers-shared/utils/configuration/parseHeaders.js';\nimport { parseRedirects } from '../workers-sdk/packages/workers-shared/utils/configuration/parseRedirects.js';\nimport { getContentType } from '../workers-sdk/packages/workers-shared/utils/helpers.js';\n\nimport type { AssetConfig, RouterConfig } from '../workers-sdk/packages/workers-shared/utils/types.js';\nimport type { Compiler } from '@rspack/core';\n\ntype Logger = ReturnType<Compiler['getInfrastructureLogger']>;\ntype MiniflareRequest = InstanceType<typeof miniflare.Request>;\n\n/** The slice of rspack's output filesystem we read from; the dev server swaps in an in-memory one. */\nexport interface ReadableFileSystem {\n\treadFile: (filePath: string, callback: (error: NodeJS.ErrnoException | null, data?: Buffer | string) => void) => void;\n\tstat: (filePath: string, callback: (error: NodeJS.ErrnoException | null, stats?: { isFile: () => boolean; }) => void) => void;\n}\n\n/** The router and asset Worker configs wrangler generates for a Worker with assets. */\nexport interface AssetWorkerOptions {\n\trouterConfig: RouterConfig;\n\tassetConfig: AssetConfig;\n}\n\n/** The contents of the build's `_headers` and `_redirects`, which the asset Worker reads when it starts. */\nexport interface AssetRules {\n\theaders: string | undefined;\n\tredirects: string | undefined;\n}\n\nexport const ROUTER_WORKER_NAME = '__rspack-plugin-cloudflare-router__';\nexport const ASSET_WORKER_NAME = '__rspack-plugin-cloudflare-assets__';\n// the date and flags the Vite plugin runs the same Workers with\nconst INTERNAL_WORKERS_COMPATIBILITY_DATE = '2024-10-04';\n// configuration rather than content, which wrangler never uploads as assets\nconst RESERVED_FILES = new Set(['/_headers', '/_redirects', '/.assetsignore']);\n\n// Miniflare's JSON bindings reject the undefined values wrangler leaves on options that aren't set\nfunction toJsonBinding(config: AssetConfig | RouterConfig) {\n\treturn Object.fromEntries(Object.entries(config).filter(([, value]) => value !== undefined));\n}\n\nfunction getInternalWorkerPath(name: string) {\n\treturn fileURLToPath(new URL(`workers/${name}/index.js`, import.meta.url));\n}\n\nfunction statFile(fileSystem: ReadableFileSystem, filePath: string) {\n\treturn new Promise<boolean>((resolve) => {\n\t\tfileSystem.stat(filePath, (error, stats) => {\n\t\t\tresolve(!error && Boolean(stats?.isFile()));\n\t\t});\n\t});\n}\n\nfunction readFile(fileSystem: ReadableFileSystem, filePath: string) {\n\treturn new Promise<Buffer>((resolve, reject) => {\n\t\tfileSystem.readFile(filePath, (error, data) => {\n\t\t\tif (error || data === undefined) {\n\t\t\t\treject(error ?? new Error(`Could not read ${filePath}`));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresolve(Buffer.from(data));\n\t\t});\n\t});\n}\n\n/**\n * Finds asset files for the asset Worker, reading the compiler's output filesystem first so files only emitted in\n * memory by the dev server are visible, then the assets directory on disk.\n */\nexport class DevAssets {\n\treadonly #roots: string[];\n\treadonly #getOutputFileSystem: () => ReadableFileSystem | undefined;\n\treadonly #waitUntilValid: () => Promise<void>;\n\n\tconstructor(options: {\n\t\tdirectory: string;\n\t\t/** More directories served at the root, checked after `directory`. */\n\t\textraDirectories: string[];\n\t\tgetOutputFileSystem: () => ReadableFileSystem | undefined;\n\t\twaitUntilValid: () => Promise<void>;\n\t}) {\n\t\tthis.#roots = [options.directory, ...options.extraDirectories];\n\t\tthis.#getOutputFileSystem = options.getOutputFileSystem;\n\t\tthis.#waitUntilValid = options.waitUntilValid;\n\t}\n\n\tasync #find(pathname: string) {\n\t\tconst outputFileSystem = this.#getOutputFileSystem();\n\t\tfor (const root of this.#roots) {\n\t\t\tconst filePath = path.join(root, pathname);\n\t\t\t// path.join normalizes `..`, so anything still escaping the root is a traversal attempt\n\t\t\tif (!filePath.startsWith(root + path.sep)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (outputFileSystem && await statFile(outputFileSystem, filePath)) {\n\t\t\t\treturn { fileSystem: outputFileSystem, filePath };\n\t\t\t}\n\t\t\tif (await statFile(fs, filePath)) {\n\t\t\t\treturn { fileSystem: fs, filePath };\n\t\t\t}\n\t\t}\n\t}\n\n\tasync #readText(pathname: string) {\n\t\tconst file = await this.#find(pathname);\n\t\treturn file && String(await readFile(file.fileSystem, file.filePath));\n\t}\n\n\tasync readRules(): Promise<AssetRules> {\n\t\tawait this.#waitUntilValid();\n\t\treturn { headers: await this.#readText('/_headers'), redirects: await this.#readText('/_redirects') };\n\t}\n\n\t/** Answers the asset Worker's lookups, using the pathname itself as the ETag. */\n\tasync handle(request: MiniflareRequest) {\n\t\tconst url = new URL(request.url);\n\t\tconst pathname = url.searchParams.get(url.pathname === '/exists' ? 'pathname' : 'eTag') ?? '';\n\t\tawait this.#waitUntilValid();\n\t\tconst file = RESERVED_FILES.has(pathname) ? undefined : await this.#find(pathname);\n\t\tif (url.pathname === '/exists') {\n\t\t\treturn miniflare.Response.json(file ? pathname : null);\n\t\t}\n\t\tif (!file) {\n\t\t\treturn new miniflare.Response(null, { status: 404 });\n\t\t}\n\t\tconst body = await readFile(file.fileSystem, file.filePath);\n\t\t// the content types wrangler gives assets when it uploads them\n\t\treturn new miniflare.Response(body, { headers: { 'Content-Type': getContentType(file.filePath) ?? 'application/octet-stream' } });\n\t}\n}\n\n/** Adds the build's `_headers` and `_redirects` to wrangler's asset config, the way Miniflare does for wrangler dev. */\nexport function getAssetConfig(options: AssetWorkerOptions, rules: AssetRules, logger: Logger): AssetConfig {\n\tconst { assetConfig, routerConfig } = options;\n\tconst parserLogger = {\n\t\t// the count of valid rules on every restart is noise; invalid ones still warn\n\t\tdebug: () => {},\n\t\tlog: () => {},\n\t\tinfo: (message: string) => logger.info(message),\n\t\twarn: (message: string) => logger.warn(message),\n\t\terror: (error: Error) => logger.error(error.message),\n\t};\n\tconst config: AssetConfig = { ...assetConfig, debug: true, has_static_routing: Boolean(routerConfig.static_routing) };\n\tif (rules.redirects !== undefined) {\n\t\tconst redirects = parseRedirects(rules.redirects, { htmlHandling: assetConfig.html_handling });\n\t\tObject.assign(config, constructRedirects({ redirects, redirectsFile: '_redirects', logger: parserLogger }));\n\t}\n\tif (rules.headers !== undefined) {\n\t\tObject.assign(config, constructHeaders({ headers: parseHeaders(rules.headers), headersFile: '_headers', logger: parserLogger }));\n\t}\n\treturn config;\n}\n\n/** Miniflare options for Cloudflare's router and asset Workers, with assets coming from `assets` instead of a manifest. */\nexport function getAssetWorkers(options: { routerConfig: RouterConfig; assetConfig: AssetConfig; userWorkerName: string | undefined; assets: DevAssets; }) {\n\tconst routerPath = getInternalWorkerPath('router-worker');\n\tconst assetPath = getInternalWorkerPath('asset-worker');\n\treturn [\n\t\t{\n\t\t\tname: ROUTER_WORKER_NAME,\n\t\t\tcompatibilityDate: INTERNAL_WORKERS_COMPATIBILITY_DATE,\n\t\t\t// the outer entrypoint reaches the inner one through ctx.exports\n\t\t\tcompatibilityFlags: ['enable_ctx_exports'],\n\t\t\tmodulesRoot: path.dirname(routerPath),\n\t\t\tmodules: [{ type: 'ESModule', path: routerPath }],\n\t\t\tbindings: { CONFIG: toJsonBinding(options.routerConfig) },\n\t\t\tserviceBindings: {\n\t\t\t\tASSET_WORKER: ASSET_WORKER_NAME,\n\t\t\t\t...(options.userWorkerName !== undefined && { USER_WORKER: options.userWorkerName }),\n\t\t\t},\n\t\t\t// internal to this session, so other dev sessions shouldn't see them in the dev registry\n\t\t\tunsafeRegisterWorker: false,\n\t\t},\n\t\t{\n\t\t\tname: ASSET_WORKER_NAME,\n\t\t\tcompatibilityDate: INTERNAL_WORKERS_COMPATIBILITY_DATE,\n\t\t\tmodulesRoot: path.dirname(assetPath),\n\t\t\tmodules: [{ type: 'ESModule', path: assetPath }],\n\t\t\tbindings: { CONFIG: toJsonBinding(options.assetConfig) },\n\t\t\tserviceBindings: { __RSPACK_ASSETS__: (request: MiniflareRequest) => options.assets.handle(request) },\n\t\t\tunsafeRegisterWorker: false,\n\t\t},\n\t];\n}\n","import path from 'node:path';\n\nimport {\n\tcleanupContainers,\n\tcreateContainerDevPlan,\n\tprepareContainerImagesForDev,\n\tresolveDockerHost,\n} from '@cloudflare/containers-shared';\n\nimport type { WorkerConfig } from './options.js';\nimport type { ContainerDevOptions, ViteLogger } from '@cloudflare/containers-shared';\n\nexport { generateContainerBuildId } from '@cloudflare/containers-shared';\n\n/** `WRANGLER_DOCKER_BIN`, like wrangler, so both find the same Docker. */\nexport function getDockerPath() {\n\treturn process.env.WRANGLER_DOCKER_BIN || 'docker';\n}\n\n/** The images a Worker's Containers need, tagged to match the Durable Object options wrangler generates with the same build id. */\nexport function getContainerOptions(config: WorkerConfig, containerBuildId: string): ContainerDevOptions[] {\n\tconst plan = createContainerDevPlan({\n\t\tcontainers: config.containers,\n\t\texports: config.exports,\n\t\tconfigPath: config.configPath,\n\t\tcontainerBuildId,\n\t});\n\treturn plan?.containerOptions ?? [];\n}\n\n/** The Docker endpoint workerd starts containers through; Miniflare picks the egress sidecar image itself. */\nexport function getContainerEngine(config: WorkerConfig, dockerPath: string) {\n\treturn config.dev.container_engine ?? resolveDockerHost(dockerPath);\n}\n\n/** Builds or pulls each image and the egress sidecar the way wrangler dev does, including its Windows and Docker checks. */\nexport async function prepareContainerImages(options: { config: WorkerConfig; dockerPath: string; containerOptions: ContainerDevOptions[]; logger: ViteLogger; }) {\n\tconst { config } = options;\n\tawait prepareContainerImagesForDev({\n\t\tdockerPath: options.dockerPath,\n\t\tcontainerOptions: options.containerOptions,\n\t\tonContainerImagePreparationStart: () => {},\n\t\tonContainerImagePreparationEnd: () => {},\n\t\tlogger: options.logger,\n\t\tcomplianceConfig: config,\n\t\tconfigFileName: path.basename(config.configPath ?? 'wrangler.json'),\n\t\tregistryConfigureCommand: 'wrangler containers registries configure',\n\t});\n}\n\n/** Force-removes containers started from these images; synchronous so it can also run while the process exits. */\nexport function removeContainers(dockerPath: string, tags: Set<string>) {\n\tif (tags.size > 0) {\n\t\tcleanupContainers(dockerPath, tags);\n\t}\n}\n","import { fileURLToPath } from 'node:url';\n\nimport type { ResolvedWorker } from './config.js';\n\nconst RUNTIME_PATH = fileURLToPath(new URL('../runtime/dev-runtime.js', import.meta.url));\n\n// these names are shared with runtime/dev-runtime.js\nexport const HMR_RUNNER_CLASS = '__RSPACK_HMR_RUNNER__';\nexport const HMR_TOKEN_BINDING = '__RSPACK_HMR_TOKEN__';\nexport const HMR_HEADER = 'x-rspack-plugin-cloudflare-hmr';\n\nfunction toSpecifier(filePath: string) {\n\treturn JSON.stringify(filePath.replaceAll('\\\\', '/'));\n}\n\n/** Export names we can know before building: `default` plus the Durable Object and Workflow classes this Worker owns. */\nexport function getConfiguredExports(worker: ResolvedWorker) {\n\tconst names = new Set(['default']);\n\tfor (const binding of worker.config.durable_objects.bindings) {\n\t\tif (!binding.script_name) {\n\t\t\tnames.add(binding.class_name);\n\t\t}\n\t}\n\tfor (const workflow of worker.config.workflows) {\n\t\tif (!workflow.script_name) {\n\t\t\tnames.add(workflow.class_name);\n\t\t}\n\t}\n\treturn [...names].toSorted((left, right) => left.localeCompare(right));\n}\n\n/**\n * Source for the dev-only entry around `main`. It accepts hot updates to `main` so rspack re-evaluates the changed\n * modules in place, and re-exports each of the user's exports through a wrapper that always calls the current code.\n */\nexport function createDevEntrySource(main: string, exportNames: string[]) {\n\tconst mainSpecifier = toSpecifier(main);\n\tconst lines = [\n\t\t`import * as worker from ${mainSpecifier};`,\n\t\t`import { initialize, wrapExport, RspackHmrRunner } from ${toSpecifier(RUNTIME_PATH)};`,\n\t\t'initialize(() => worker);',\n\t\t`if (import.meta.webpackHot) import.meta.webpackHot.accept(${mainSpecifier});`,\n\t\t`export { RspackHmrRunner as ${HMR_RUNNER_CLASS} };`,\n\t];\n\tfor (const [index, name] of exportNames.entries()) {\n\t\t// string export names cover anything the user exported, even names that aren't valid identifiers\n\t\tlines.push(`const export${index} = wrapExport(${JSON.stringify(name)});`, `export { export${index} as ${JSON.stringify(name)} };`);\n\t}\n\treturn `${lines.join('\\n')}\\n`;\n}\n","import { randomUUID } from 'node:crypto';\nimport { readFileSync } from 'node:fs';\nimport fs from 'node:fs/promises';\nimport path from 'node:path';\n\nimport { convertConfigToBindings } from '@cloudflare/workers-utils';\nimport { maybeStartOrUpdateRemoteProxySession, unstable_getMiniflareWorkerOptions } from 'wrangler';\n\nimport { generateContainerBuildId, getContainerOptions } from './containers.js';\nimport {\n\tHMR_HEADER,\n\tHMR_RUNNER_CLASS,\n\tHMR_TOKEN_BINDING,\n\tcreateDevEntrySource,\n\tgetConfiguredExports,\n} from './dev-entry.js';\nimport { miniflare } from './miniflare.js';\nimport { IMPORTED_ASSETS_DIR, createWorkerConfig } from './worker-config.js';\n\nimport type { AssetWorkerOptions } from './assets.js';\nimport type { ResolvedWorker } from './config.js';\nimport type { CloudflarePluginOptions } from './options.js';\nimport type { AdditionalModulesPlugin, VirtualModules } from './worker-config.js';\nimport type {\n\tCompiler,\n\tMultiStats,\n\tStats,\n\tWatching,\n} from '@rspack/core';\n\ntype Logger = ReturnType<Compiler['getInfrastructureLogger']>;\ntype Miniflare = InstanceType<typeof miniflare.Miniflare>;\ntype RemoteProxySessionData = Awaited<ReturnType<typeof maybeStartOrUpdateRemoteProxySession>>;\n\n// with module output, rspack writes both update chunks and manifests (`*.hot-update.json.mjs`) as ES modules\nconst HOT_UPDATE_RE = /\\.hot-update\\.(?:json\\.)?mjs$/;\n\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n\treturn typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/** The export names rspack found on `main`, or undefined when it couldn't tell, like for CommonJS. */\nfunction getProvidedExports(stats: Stats, main: string) {\n\tconst { modules = [] } = stats.toJson({ all: false, modules: true, providedExports: true });\n\tconst mainModule = modules.find(module => module.nameForCondition && path.resolve(module.nameForCondition) === path.resolve(main));\n\tconst provided = mainModule?.providedExports;\n\treturn Array.isArray(provided) ? provided.map(String).toSorted((left, right) => left.localeCompare(right)) : undefined;\n}\n\ninterface DevWorkerEvents {\n\t/** A build began, so requests should wait for it. */\n\tonBuildStart: (worker: DevWorker) => void;\n\t/** A build finished, successfully or not; `buildError` says which. */\n\tonBuildDone: (worker: DevWorker) => Promise<void>;\n}\n\n/** One Worker in a dev session: its rspack watcher, its hot updates, and its slice of the Miniflare config. */\nexport class DevWorker {\n\treadonly #compiler: Compiler;\n\treadonly #options: CloudflarePluginOptions;\n\treadonly #logger: Logger;\n\treadonly #events: DevWorkerEvents;\n\treadonly #resolve: () => Promise<ResolvedWorker>;\n\t// proves an update request came from this session rather than a browser that happened to send the header\n\treadonly #hmrToken = randomUUID();\n\t#resolved: ResolvedWorker;\n\t#watching: Watching | undefined;\n\t#virtualModules: VirtualModules | undefined;\n\t#additionalModules: AdditionalModulesPlugin | undefined;\n\t// the names the dev entry re-exports, which workerd bound when the Worker last (re)started\n\t#exportNames: string[] = [];\n\t#loadedModules = '';\n\t#builtModules: { type: string; path: string; contents: Buffer; }[] = [];\n\t#restartReason: string | undefined = 'it is starting';\n\t#remoteProxy: RemoteProxySessionData = null;\n\t// new on every (re)start so changed Dockerfiles get fresh image tags instead of reusing stale images\n\t#containerBuildId = '';\n\tbuildError: string | undefined;\n\tbuilding = true;\n\n\tconstructor(options: { compiler: Compiler; resolved: ResolvedWorker; resolve: () => Promise<ResolvedWorker>; pluginOptions: CloudflarePluginOptions; logger: Logger; events: DevWorkerEvents; }) {\n\t\tthis.#compiler = options.compiler;\n\t\tthis.#options = options.pluginOptions;\n\t\tthis.#logger = options.logger;\n\t\tthis.#events = options.events;\n\t\tthis.#resolve = options.resolve;\n\t\tthis.#resolved = options.resolved;\n\t}\n\n\t// on disk rather than in memory so workerd can read the bundle's source maps for stack traces\n\tget #outputDir() {\n\t\treturn path.join(this.#resolved.rootDir, '.wrangler', 'rspack', this.#resolved.name);\n\t}\n\n\t// a virtual module, so it only needs a path that resolves imports the same way main does\n\tget #entryPath() {\n\t\treturn path.join(this.#resolved.rootDir, '.wrangler', 'tmp', `rspack-${this.#resolved.name}`, 'dev-entry.js');\n\t}\n\n\t/** Records a finished build, returning false when it triggered another build that should be waited for instead. */\n\t#handleBuild(main: string, error: Error | null, stats: Stats | MultiStats | undefined) {\n\t\tif (error || !stats || stats.hasErrors() || !('compilation' in stats)) {\n\t\t\tthis.buildError = error?.message ?? stats?.toString({ preset: 'errors-only', colors: false }) ?? 'Unknown error';\n\t\t\treturn true;\n\t\t}\n\t\tconst exportNames = getProvidedExports(stats, main);\n\t\tif (exportNames && exportNames.join(',') !== this.#exportNames.join(',')) {\n\t\t\t// the dev entry re-exports by name and workerd binds exports at startup, so regenerate it and restart on the rebuild\n\t\t\tthis.#exportNames = exportNames;\n\t\t\tthis.#restartReason ??= 'its exports changed';\n\t\t\tthis.#virtualModules?.writeModule(this.#entryPath, createDevEntrySource(main, exportNames));\n\t\t\tthis.#rebuildEntry();\n\t\t\treturn false;\n\t\t}\n\t\tconst entryExports = getProvidedExports(stats, this.#entryPath)?.filter(name => name !== HMR_RUNNER_CLASS);\n\t\tif (entryExports && entryExports.join(',') !== this.#exportNames.join(',')) {\n\t\t\t// workerd binds whatever the built entry exports, so a build that missed the rewrite must not reach it\n\t\t\tthis.#rebuildEntry();\n\t\t\treturn false;\n\t\t}\n\t\tthis.buildError = undefined;\n\t\treturn true;\n\t}\n\n\t// the watcher is paused while a build callback runs and can drop the virtual entry's change event, and a bare\n\t// invalidate() then rebuilds with the old entry, so name the changed file outright\n\t#rebuildEntry() {\n\t\tthis.#watching?.invalidateWithChangesAndRemovals(new Set([this.#entryPath]));\n\t}\n\n\t#getModules() {\n\t\tconst modules = [{ type: 'ESModule', path: path.join(this.#outputDir, 'index.js') }];\n\t\tfor (const { fileName, type } of this.#additionalModules?.modules ?? []) {\n\t\t\tmodules.push({ type, path: path.join(this.#outputDir, fileName) });\n\t\t}\n\t\treturn modules;\n\t}\n\n\t// read while the build callback runs, since the next build can start rewriting these files before Miniflare loads them\n\t#readBuiltModules() {\n\t\treturn this.#getModules().map((module) => {\n\t\t\treturn { ...module, contents: readFileSync(module.path) };\n\t\t});\n\t}\n\n\t/** Starts or refreshes the proxy for bindings marked `remote: true`, which wrangler only opens when some exist. */\n\tasync #getRemoteProxyConnectionString() {\n\t\tif (this.#options.remoteBindings === false) {\n\t\t\treturn;\n\t\t}\n\t\tconst { config } = this.#resolved;\n\t\tthis.#remoteProxy = await maybeStartOrUpdateRemoteProxySession({\n\t\t\tname: config.name,\n\t\t\tbindings: convertConfigToBindings(config, { usePreviewIds: true }),\n\t\t\taccount_id: config.account_id,\n\t\t\tcomplianceRegion: config.compliance_region,\n\t\t}, this.#remoteProxy);\n\t\treturn this.#remoteProxy?.session.remoteProxyConnectionString;\n\t}\n\n\tasync #closeWatcher() {\n\t\tconst watching = this.#watching;\n\t\tthis.#watching = undefined;\n\t\tawait new Promise<void>((resolve) => {\n\t\t\tif (watching) {\n\t\t\t\twatching.close(() => resolve());\n\t\t\t} else {\n\t\t\t\tresolve();\n\t\t\t}\n\t\t});\n\t}\n\n\tget resolved() {\n\t\treturn this.#resolved;\n\t}\n\n\tget name() {\n\t\treturn this.#resolved.name;\n\t}\n\n\t/** Why the next build needs a restart instead of a hot update, if it does. */\n\tget restartReason() {\n\t\tif (this.#restartReason) {\n\t\t\treturn this.#restartReason;\n\t\t}\n\t\tif (JSON.stringify(this.#getModules()) !== this.#loadedModules) {\n\t\t\treturn 'its .wasm or .bin modules changed';\n\t\t}\n\t}\n\n\tstart() {\n\t\tconst { main } = this.#resolved;\n\t\tthis.#containerBuildId = generateContainerBuildId();\n\t\tif (!main) {\n\t\t\tthis.building = false;\n\t\t\treturn;\n\t\t}\n\t\tthis.building = true;\n\t\tthis.#exportNames = getConfiguredExports(this.#resolved);\n\t\tconst { config, virtualModules, additionalModules } = createWorkerConfig({\n\t\t\tcompiler: this.#compiler,\n\t\t\tworker: this.#resolved,\n\t\t\tpluginOptions: this.#options,\n\t\t\toutputDir: this.#outputDir,\n\t\t\tentry: this.#entryPath,\n\t\t\tentrySource: createDevEntrySource(main, this.#exportNames),\n\t\t\tmode: 'development',\n\t\t\thot: true,\n\t\t\t// a prefix per Worker, so Miniflare's module fallback can tell whose hot update is being imported\n\t\t\tpublicPath: `/${this.name}/`,\n\t\t});\n\t\tthis.#virtualModules = virtualModules;\n\t\tthis.#additionalModules = additionalModules;\n\t\tconst workerCompiler = this.#compiler.rspack.rspack(config);\n\t\tworkerCompiler.hooks.invalid.tap('rspack-plugin-cloudflare', () => {\n\t\t\tthis.building = true;\n\t\t\tthis.#events.onBuildStart(this);\n\t\t});\n\t\tthis.#watching = workerCompiler.watch({}, (error, stats) => {\n\t\t\tif (this.#handleBuild(main, error, stats)) {\n\t\t\t\tif (!this.buildError) {\n\t\t\t\t\tthis.#builtModules = this.#readBuiltModules();\n\t\t\t\t}\n\t\t\t\tthis.building = false;\n\t\t\t\tthis.#events.onBuildDone(this).catch((loadError: unknown) => {\n\t\t\t\t\tthis.#logger.error(`Worker \"${this.name}\" failed to load: ${String(loadError)}`);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n\n\t/** Re-reads the config and rebuilds from scratch, since anything from `main` to bindings may have changed. */\n\tasync reload() {\n\t\t// read first, so a broken config leaves the current build running rather than stopping it\n\t\tconst resolved = await this.#resolve();\n\t\tawait this.#closeWatcher();\n\t\tthis.#resolved = resolved;\n\t\tthis.#restartReason = 'its config changed';\n\t\tthis.start();\n\t}\n\n\t/** Records that Miniflare is now running this Worker's latest build. */\n\tmarkLoaded() {\n\t\tthis.#restartReason = undefined;\n\t\tthis.#loadedModules = JSON.stringify(this.#getModules());\n\t}\n\n\t/** Asks the running Worker to apply its pending hot update, through a fetch its dev entry recognizes by token. */\n\tasync applyHotUpdate(mf: Miniflare): Promise<{ reload: boolean; reason?: string; }> {\n\t\tconst response = await mf.dispatchFetch('http://localhost/', {\n\t\t\theaders: { [HMR_HEADER]: this.#hmrToken, [miniflare.CoreHeaders.ROUTE_OVERRIDE]: this.name },\n\t\t});\n\t\t// a Worker that can't answer properly gets restarted rather than leaving dev broken\n\t\tconst result: unknown = await response.json().catch(() => {});\n\t\tif (isPlainObject(result) && result.reload === false) {\n\t\t\treturn { reload: false };\n\t\t}\n\t\tconst reason = isPlainObject(result) && typeof result.reason === 'string' ? result.reason : `the update request failed (${response.status})`;\n\t\treturn { reload: true, reason };\n\t}\n\n\t/** Reads one of this Worker's hot-update modules, given its path below the Worker's public path. */\n\tasync readHotUpdate(relativePath: string) {\n\t\tconst filePath = path.join(this.#outputDir, relativePath);\n\t\t// anything other than a hot update is a genuinely missing import, which should fail like it would in production\n\t\tif (!HOT_UPDATE_RE.test(filePath) || !filePath.startsWith(this.#outputDir + path.sep)) {\n\t\t\treturn;\n\t\t}\n\t\treturn fs.readFile(filePath, 'utf8');\n\t}\n\n\t/** Where assets imported by the Worker's code are emitted, laid out the way they're served. */\n\tget importedAssetsDir() {\n\t\treturn path.join(this.#outputDir, IMPORTED_ASSETS_DIR);\n\t}\n\n\t/**\n\t * This Worker's Miniflare options, any external Workers wrangler adds for its bindings, the container images it needs,\n\t * and its asset options, which configure the router and asset Workers the session runs.\n\t */\n\tasync getMiniflareOptions(extraServiceBindings: Record<string, unknown>, inspectorEnabled: boolean) {\n\t\tconst { config, environment } = this.#resolved;\n\t\tconst remoteProxyConnectionString = await this.#getRemoteProxyConnectionString();\n\t\tconst { workerOptions, externalWorkers } = unstable_getMiniflareWorkerOptions(config, environment, {\n\t\t\tremoteProxyConnectionString,\n\t\t\tcontainerBuildId: this.#containerBuildId,\n\t\t});\n\t\t// assets are left out of the Worker because the session runs the router and asset Workers itself\n\t\tconst { modulesRules: _modulesRules, assets, ...options } = workerOptions;\n\t\tconst containersEnabled = Boolean(config.containers?.length) && config.dev.enable_containers;\n\t\tlet assetWorkerOptions: AssetWorkerOptions | undefined;\n\t\tif (assets) {\n\t\t\tconst { routerConfig, assetConfig } = assets as AssetWorkerOptions;\n\t\t\tassetWorkerOptions = { routerConfig, assetConfig };\n\t\t}\n\t\treturn {\n\t\t\tassetWorkerOptions,\n\t\t\texternalWorkers,\n\t\t\tcontainerOptions: containersEnabled ? getContainerOptions(config, this.#containerBuildId) : [],\n\t\t\tworker: {\n\t\t\t\t...options,\n\t\t\t\tname: this.name,\n\t\t\t\tdurableObjects: {\n\t\t\t\t\t...(options.durableObjects as Record<string, unknown> | undefined),\n\t\t\t\t\t// applies hot updates; ephemeral and never evicted so its I/O context lives as long as the modules it evaluates\n\t\t\t\t\t[HMR_RUNNER_CLASS]: { className: HMR_RUNNER_CLASS, unsafeUniqueKey: miniflare.kUnsafeEphemeralUniqueKey, unsafePreventEviction: true },\n\t\t\t\t},\n\t\t\t\tunsafeUseModuleFallbackService: true,\n\t\t\t\tbindings: { ...(options.bindings as Record<string, unknown> | undefined), [HMR_TOKEN_BINDING]: this.#hmrToken },\n\t\t\t\tserviceBindings: { ...(options.serviceBindings as Record<string, unknown> | undefined), ...extraServiceBindings },\n\t\t\t\t// rspack already bundled everything into one module, so module rules have nothing left to match\n\t\t\t\tmodulesRoot: this.#outputDir,\n\t\t\t\tmodules: this.#builtModules,\n\t\t\t\tunsafeInspectorProxy: inspectorEnabled,\n\t\t\t},\n\t\t};\n\t}\n\n\tasync dispose() {\n\t\tawait this.#closeWatcher();\n\t\tawait this.#remoteProxy?.session.dispose();\n\t\tthis.#remoteProxy = null;\n\t}\n}\n","import { Readable } from 'node:stream';\n\nimport type { IncomingMessage, ServerResponse } from 'node:http';\nimport type { TLSSocket } from 'node:tls';\n\nexport function getRequestUrl(req: IncomingMessage) {\n\tconst forwardedProto = req.headers['x-forwarded-proto'];\n\tlet protocol = 'http:';\n\tif (typeof forwardedProto === 'string') {\n\t\tprotocol = `${forwardedProto.split(',', 1)[0]?.trim()}:`;\n\t} else if ((req.socket as TLSSocket).encrypted) {\n\t\tprotocol = 'https:';\n\t}\n\tconst host = req.headers[':authority'] ?? req.headers.host ?? 'localhost';\n\treturn new URL(req.url ?? '/', `${protocol}//${String(host)}`);\n}\n\nexport function getRequestHeaders(req: IncomingMessage) {\n\tconst headers = new Headers();\n\tfor (const [name, value] of Object.entries(req.headers)) {\n\t\t// HTTP/2 pseudo-headers can't be set on a fetch Headers object\n\t\tif (value === undefined || name.startsWith(':')) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(value)) {\n\t\t\tfor (const item of value) {\n\t\t\t\theaders.append(name, item);\n\t\t\t}\n\t\t} else {\n\t\t\theaders.set(name, value);\n\t\t}\n\t}\n\treturn headers;\n}\n\nexport function createRequestInit(req: IncomingMessage, res: ServerResponse) {\n\tconst controller = new AbortController();\n\tres.on('close', () => controller.abort());\n\tconst headers = getRequestHeaders(req);\n\t// responses come back through undici, which decodes compressed bodies but keeps Content-Encoding; asking for identity avoids a mismatch\n\theaders.set('accept-encoding', 'identity');\n\tconst method = req.method ?? 'GET';\n\tconst hasBody = method !== 'GET' && method !== 'HEAD';\n\treturn {\n\t\tmethod,\n\t\t// entries rather than a Headers object, since Miniflare's undici has its own Headers class\n\t\theaders: [...headers],\n\t\tbody: hasBody ? Readable.toWeb(req) as ReadableStream : undefined,\n\t\tduplex: 'half' as const,\n\t\tredirect: 'manual' as const,\n\t\tsignal: controller.signal,\n\t};\n}\n\nfunction escapeHtml(text: string) {\n\treturn text.replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;');\n}\n\n/** Responds with the error's (source-mapped) stack, as a page for browsers and plain text for everything else. */\nexport function sendErrorPage(res: ServerResponse, error: unknown) {\n\tif (res.headersSent) {\n\t\tres.destroy();\n\t\treturn;\n\t}\n\tconst message = error instanceof Error ? error.stack ?? error.message : String(error);\n\tif (res.req.headers.accept?.includes('text/html')) {\n\t\tres.writeHead(500, { 'Content-Type': 'text/html; charset=utf-8' });\n\t\tres.end(`<!doctype html><title>Worker error</title><body style=\"font-family:system-ui;margin:2rem\"><h1>Worker error</h1><pre style=\"white-space:pre-wrap\">${escapeHtml(message)}</pre></body>`);\n\t\treturn;\n\t}\n\tres.writeHead(500, { 'Content-Type': 'text/plain; charset=utf-8' });\n\tres.end(message);\n}\n\n/** The parts of a fetch Response we forward, so Miniflare's own undici Response fits as well as the global one. */\ninterface ForwardableResponse {\n\tstatus: number;\n\theaders: Iterable<[string, string]> & { getSetCookie: () => string[]; };\n\tbody: import('node:stream/web').ReadableStream | null;\n}\n\nexport function sendResponse(res: ServerResponse, response: ForwardableResponse) {\n\tconst headers: Record<string, string | string[]> = {};\n\tfor (const [name, value] of response.headers) {\n\t\tif (name === 'set-cookie') {\n\t\t\tcontinue;\n\t\t}\n\t\theaders[name] = value;\n\t}\n\tconst cookies = response.headers.getSetCookie();\n\tif (cookies.length > 0) {\n\t\theaders['set-cookie'] = cookies;\n\t}\n\tres.writeHead(response.status, headers);\n\tif (!response.body || res.req.method === 'HEAD') {\n\t\tres.end();\n\t\treturn;\n\t}\n\tconst body = Readable.fromWeb(response.body);\n\tres.on('close', () => body.destroy());\n\tbody.pipe(res);\n}\n","import net from 'node:net';\n\nexport const DEBUG_PATH = '/__debug';\nconst DEFAULT_INSPECTOR_PORT = 9229;\n\nfunction isPortFree(port: number) {\n\treturn new Promise<boolean>((resolve) => {\n\t\tconst server = net.createServer();\n\t\tserver.once('error', () => resolve(false));\n\t\tserver.listen(port, '127.0.0.1', () => {\n\t\t\tserver.close(() => resolve(true));\n\t\t});\n\t});\n}\n\n/** Resolves the inspector port: the configured one, or 9229 falling back to the next free port like the Vite plugin. */\nexport async function resolveInspectorPort(option: number | false | undefined) {\n\tif (option === false) {\n\t\treturn;\n\t}\n\tif (option !== undefined) {\n\t\treturn option;\n\t}\n\tfor (let port = DEFAULT_INSPECTOR_PORT; port < 65535; port++) {\n\t\tif (await isPortFree(port)) {\n\t\t\treturn port;\n\t\t}\n\t}\n}\n\n/** A page that sends the browser to Cloudflare's hosted DevTools, connected to each Worker through Miniflare's inspector proxy. */\nexport function getDebugPageHtml(workerNames: string[], inspectorPort: number) {\n\tconst urls = workerNames.map((name) => {\n\t\tconst params = new URLSearchParams({ theme: 'systemPreferred', debugger: 'true', ws: `localhost:${inspectorPort}/${name}`, domain: name });\n\t\treturn `https://devtools.devprod.cloudflare.dev/js_app?${params.toString()}`;\n\t});\n\treturn `<!doctype html><script>\nconst [first, ...rest] = ${JSON.stringify(urls)};\nfor (const url of rest) {\n\twindow.open(url);\n}\nwindow.location.replace(first);\n</script>`;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nimport { convertConfigToBindings, printBindings } from '@cloudflare/workers-utils';\nimport { WebSocketServer } from 'ws';\n\nimport {\n\tASSET_WORKER_NAME,\n\tDevAssets,\n\tROUTER_WORKER_NAME,\n\tgetAssetConfig,\n\tgetAssetWorkers,\n} from './assets.js';\nimport {\n\tgetContainerEngine,\n\tgetDockerPath,\n\tprepareContainerImages,\n\tremoveContainers,\n} from './containers.js';\nimport { DevWorker } from './dev-worker.js';\nimport {\n\tcreateRequestInit,\n\tgetRequestHeaders,\n\tgetRequestUrl,\n\tsendErrorPage,\n\tsendResponse,\n} from './http.js';\nimport { DEBUG_PATH, getDebugPageHtml, resolveInspectorPort } from './inspector.js';\nimport { miniflare } from './miniflare.js';\n\nimport type { AssetRules, AssetWorkerOptions, ReadableFileSystem } from './assets.js';\nimport type { ResolvedWorker } from './config.js';\nimport type { CloudflarePluginOptions, WorkerConfig } from './options.js';\nimport type { ContainerDevOptions } from '@cloudflare/containers-shared';\nimport type { Compiler } from '@rspack/core';\nimport type { FSWatcher } from 'node:fs';\nimport type { IncomingMessage, Server, ServerResponse } from 'node:http';\nimport type { Duplex } from 'node:stream';\n\ntype Logger = ReturnType<Compiler['getInfrastructureLogger']>;\n\n/** What the session needs from the dev server it runs inside. */\ninterface DevServerHooks {\n\twaitUntilValid: () => Promise<void>;\n\t/** Sends a message to connected HMR clients, which drives the browser's error overlay. */\n\tsendToClients: (type: string, data?: unknown) => void;\n}\n\nconst PLUGIN_NAME = 'rspack-plugin-cloudflare';\n// paths the dev server answers itself, before anything reaches the Workers\nconst DEV_SERVER_PATH_RE = /^\\/(?:webpack-dev-server|__webpack_dev_server__|__open-in-editor|lazy-compilation-using-)/;\n// @rspack/cli turns lazy compilation on for web builds and serves its endpoint after every other middleware\nconst LAZY_COMPILATION_PREFIX = '/_rspack/lazy/trigger';\n// Miniflare's own endpoints, like trigger handlers, which belong to the Worker rather than the asset router\nconst MINIFLARE_PATH_RE = /^\\/(?:cdn-cgi\\/local|__cf_local)\\//;\n// pre-v5 Miniflare paths still in docs and scripts, mapped the same way the Vite plugin does\nconst LEGACY_PATH_REWRITES = [\n\t['/cdn-cgi/handler', '/cdn-cgi/local'],\n\t['/cdn-cgi/mf/scheduled', '/cdn-cgi/local/scheduled'],\n\t['/cdn-cgi/mf/stream', '/__cf_local/stream'],\n\t['/cdn-cgi/mf/imagedelivery', '/__cf_local/imagedelivery'],\n\t['/cdn-cgi/explorer', '/cdn-cgi/local/explorer'],\n] as const;\n// local secrets files that wrangler reads alongside the config\nconst SECRETS_FILE_RE = /^\\.(?:dev\\.vars|env)(?:\\..+)?$/;\n\nfunction rewriteLegacyMiniflarePath(pathname: string) {\n\tfor (const [oldPrefix, newPrefix] of LEGACY_PATH_REWRITES) {\n\t\tif (pathname === oldPrefix || pathname.startsWith(`${oldPrefix}/`)) {\n\t\t\treturn newPrefix + pathname.slice(oldPrefix.length);\n\t\t}\n\t}\n\treturn pathname;\n}\n\n// read per request, since @rspack/cli only enables lazy compilation once the dev server starts\nfunction getLazyCompilationPrefix(compiler: Compiler) {\n\tconst { lazyCompilation } = compiler.options;\n\tif (typeof lazyCompilation === 'object' && lazyCompilation.prefix) {\n\t\treturn lazyCompilation.prefix;\n\t}\n\treturn LAZY_COMPILATION_PREFIX;\n}\n\n/** Runs the entry Worker and any auxiliary Workers in one Miniflare, routing dev server requests like Cloudflare does. */\nexport class DevSession {\n\t/** Reads every Worker's config before the session starts, since `cloudflare.config.ts` can only be loaded asynchronously. */\n\tstatic async create(options: { compiler: Compiler; resolvers: (() => Promise<ResolvedWorker>)[]; pluginOptions: CloudflarePluginOptions; logger: Logger; }) {\n\t\tconst workers = await Promise.all(options.resolvers.map(async (resolve) => {\n\t\t\treturn { resolve, resolved: await resolve() };\n\t\t}));\n\t\treturn new DevSession({ ...options, workers });\n\t}\n\n\treadonly #compiler: Compiler;\n\treadonly #options: CloudflarePluginOptions;\n\treadonly #logger: Logger;\n\treadonly #workers: DevWorker[];\n\treadonly #entry: DevWorker;\n\t#hooks: DevServerHooks | undefined;\n\t#assets: DevAssets | undefined;\n\t#miniflare: InstanceType<typeof miniflare.Miniflare> | undefined;\n\t#inspectorPort: number | undefined;\n\treadonly #configWatchers = new Map<string, FSWatcher>();\n\treadonly #pendingReloads = new Map<DevWorker, ReturnType<typeof setTimeout>>();\n\t// images already built this session, which are also the ones whose containers need removing on exit\n\treadonly #containerTags = new Set<string>();\n\treadonly #removeContainersOnExit = () => removeContainers(getDockerPath(), this.#containerTags);\n\t// Workers rebuilt since Miniflare last picked up their code, and those whose build is failing\n\treadonly #updated = new Set<DevWorker>();\n\treadonly #failing = new Set<DevWorker>();\n\t// builds finish independently, so loading them into Miniflare happens strictly one at a time\n\t#loading = Promise.resolve();\n\t// open while any Worker is building, so requests wait for the code they'd otherwise miss\n\t#gate: { promise: Promise<void>; release: () => void; } | undefined;\n\t// the `_headers` and `_redirects` Miniflare last started the asset Worker with\n\t#assetRules: AssetRules | undefined;\n\n\tprivate constructor(options: { compiler: Compiler; workers: { resolved: ResolvedWorker; resolve: () => Promise<ResolvedWorker>; }[]; pluginOptions: CloudflarePluginOptions; logger: Logger; }) {\n\t\tthis.#compiler = options.compiler;\n\t\tthis.#options = options.pluginOptions;\n\t\tthis.#logger = options.logger;\n\t\tthis.#workers = options.workers.map(({ resolved, resolve }) => new DevWorker({\n\t\t\tcompiler: options.compiler,\n\t\t\tresolved,\n\t\t\tresolve,\n\t\t\tpluginOptions: options.pluginOptions,\n\t\t\tlogger: options.logger,\n\t\t\tevents: {\n\t\t\t\tonBuildStart: () => this.#openGate(),\n\t\t\t\tonBuildDone: (worker) => {\n\t\t\t\t\tthis.#loading = this.#loading.then(() => this.#onBuildDone(worker));\n\t\t\t\t\treturn this.#loading;\n\t\t\t\t},\n\t\t\t},\n\t\t}));\n\t\tconst [entry] = this.#workers;\n\t\tif (!entry) {\n\t\t\tthrow new Error('A dev session needs at least one Worker.');\n\t\t}\n\t\tthis.#entry = entry;\n\t\tthis.#openGate();\n\t}\n\n\t#openGate() {\n\t\tif (this.#gate) {\n\t\t\treturn;\n\t\t}\n\t\tconst { promise, resolve } = Promise.withResolvers<void>();\n\t\tthis.#gate = { promise, release: resolve };\n\t}\n\n\t#releaseGateIfIdle() {\n\t\tif (this.#gate && this.#workers.every(worker => !worker.building)) {\n\t\t\tthis.#gate.release();\n\t\t\tthis.#gate = undefined;\n\t\t}\n\t}\n\n\tasync #ready() {\n\t\twhile (this.#gate) {\n\t\t\tawait this.#gate.promise;\n\t\t}\n\t\treturn this.#miniflare;\n\t}\n\n\tasync #onBuildDone(worker: DevWorker) {\n\t\tif (worker.buildError) {\n\t\t\tthis.#failing.add(worker);\n\t\t\tthis.#logger.error(`Worker \"${worker.name}\" build failed${this.#miniflare ? '; still serving the previous build' : ''}:\\n${worker.buildError}`);\n\t\t\tthis.#hooks?.sendToClients('errors', [{ moduleName: `Worker \"${worker.name}\"`, message: worker.buildError }]);\n\t\t} else {\n\t\t\tthis.#updated.add(worker);\n\t\t\tif (this.#failing.delete(worker) && this.#failing.size === 0) {\n\t\t\t\t// dismisses the overlay without reloading the page\n\t\t\t\tthis.#hooks?.sendToClients('still-ok');\n\t\t\t}\n\t\t}\n\t\t// the last Worker to finish loads everyone's changes together\n\t\tif (this.#workers.some(other => other.building)) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tawait this.#load();\n\t\t} catch (error) {\n\t\t\tthis.#logger.error(`Workers failed to start:\\n${String(error)}`);\n\t\t}\n\t\tthis.#releaseGateIfIdle();\n\t}\n\n\t/** Gets new builds running: hot updates when possible, otherwise a restart of every Worker. */\n\tasync #load() {\n\t\tif (!this.#miniflare) {\n\t\t\tif (this.#failing.size > 0) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#miniflare = new miniflare.Miniflare(await this.#getMiniflareOptions());\n\t\t\tawait this.#miniflare.ready;\n\t\t\tthis.#printReady();\n\t\t\tthis.#markLoaded();\n\t\t\treturn;\n\t\t}\n\n\t\tconst restart = this.#workers.find(worker => worker.restartReason);\n\t\tif (restart) {\n\t\t\tawait this.#restart(`Worker \"${restart.name}\" restarted: ${restart.restartReason ?? ''}`);\n\t\t\treturn;\n\t\t}\n\t\tfor (const worker of this.#updated) {\n\t\t\tconst result = await worker.applyHotUpdate(this.#miniflare);\n\t\t\tif (result.reload) {\n\t\t\t\tawait this.#restart(`Worker \"${worker.name}\" restarted: ${result.reason ?? 'the update could not be applied in place'}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.#logger.info(`Worker \"${worker.name}\" hot updated`);\n\t\t}\n\t\tthis.#updated.clear();\n\t}\n\n\tasync #restart(message: string) {\n\t\tawait this.#miniflare?.setOptions(await this.#getMiniflareOptions());\n\t\tthis.#logger.info(message);\n\t\tthis.#markLoaded();\n\t}\n\n\t#markLoaded() {\n\t\tfor (const worker of this.#workers) {\n\t\t\tworker.markLoaded();\n\t\t}\n\t\tthis.#updated.clear();\n\t}\n\n\t#printReady() {\n\t\tfor (const worker of this.#workers) {\n\t\t\tconst { config, name } = worker.resolved;\n\t\t\tprintBindings(convertConfigToBindings(config, { usePreviewIds: true }), {\n\t\t\t\tname,\n\t\t\t\tlocal: true,\n\t\t\t\twarnIfNoBindings: false,\n\t\t\t\tisMultiWorker: this.#workers.length > 1,\n\t\t\t\tcontainers: config.containers,\n\t\t\t\ttailConsumers: config.tail_consumers,\n\t\t\t\tstreamingTailConsumers: config.streaming_tail_consumers,\n\t\t\t\tlog: (message: string) => this.#logger.info(message),\n\t\t\t});\n\t\t}\n\t\tconst names = this.#workers.map(worker => `\"${worker.name}\"`).join(', ');\n\t\tconst debug = this.#inspectorPort === undefined ? '' : `; debug at ${DEBUG_PATH} (inspector on port ${this.#inspectorPort})`;\n\t\tthis.#logger.info(`${this.#workers.length > 1 ? 'Workers' : 'Worker'} ${names} ready${debug}`);\n\t}\n\n\t/** Serves rspack's hot-update modules, which workerd imports through Miniflare's module fallback as `/<worker>/<file>`. */\n\tasync #serveHotUpdate(request: Parameters<typeof miniflare.parseModuleFallbackRequest>[0]) {\n\t\tconst parsed = await miniflare.parseModuleFallbackRequest(request);\n\t\tconst [, workerName = '', ...rest] = (parsed?.specifier ?? '').split('/');\n\t\tconst worker = this.#workers.find(candidate => candidate.name === workerName);\n\t\tconst source = await worker?.readHotUpdate(rest.join('/'));\n\t\tif (source === undefined) {\n\t\t\treturn new miniflare.Response(null, { status: 404 });\n\t\t}\n\t\treturn miniflare.Response.json({ esModule: source });\n\t}\n\n\t#assetsServiceBinding(): Record<string, unknown> {\n\t\tconst binding = this.#entry.resolved.assets?.binding;\n\t\tif (!binding || !this.#assets) {\n\t\t\treturn {};\n\t\t}\n\t\treturn { [binding]: ASSET_WORKER_NAME };\n\t}\n\n\t/** Builds images not seen yet this session, returning the engine Miniflare should start containers with. */\n\tasync #prepareContainers(workers: { config: WorkerConfig; containerOptions: ContainerDevOptions[]; }[]) {\n\t\tconst withContainers = workers.filter(worker => worker.containerOptions.length > 0);\n\t\tconst [first] = withContainers;\n\t\tif (!first) {\n\t\t\treturn;\n\t\t}\n\t\tconst dockerPath = getDockerPath();\n\t\tconst pending = withContainers.map(({ config, containerOptions }) => {\n\t\t\treturn { config, containerOptions: containerOptions.filter(options => !this.#containerTags.has(options.image_tag)) };\n\t\t});\n\t\tif (pending.some(worker => worker.containerOptions.length > 0)) {\n\t\t\tthis.#logger.info('Building container images for local development...');\n\t\t\tfor (const { config, containerOptions } of pending) {\n\t\t\t\tawait prepareContainerImages({ config, dockerPath, containerOptions, logger: this.#logger });\n\t\t\t\tfor (const options of containerOptions) {\n\t\t\t\t\tthis.#containerTags.add(options.image_tag);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// rspack serve may exit without a shutdown hook, like on a crash, and containers would keep running\n\t\t\tprocess.off('exit', this.#removeContainersOnExit);\n\t\t\tprocess.on('exit', this.#removeContainersOnExit);\n\t\t\tthis.#logger.info('Container images built; restart dev to rebuild them after changing a Dockerfile.');\n\t\t}\n\t\treturn getContainerEngine(first.config, dockerPath);\n\t}\n\n\tasync #getAssetWorkers(assetWorkerOptions: AssetWorkerOptions | undefined) {\n\t\tconst assets = this.#assets;\n\t\tif (!assetWorkerOptions || !assets) {\n\t\t\treturn [];\n\t\t}\n\t\tthis.#assetRules = await assets.readRules();\n\t\treturn getAssetWorkers({\n\t\t\trouterConfig: assetWorkerOptions.routerConfig,\n\t\t\tassetConfig: getAssetConfig(assetWorkerOptions, this.#assetRules, this.#logger),\n\t\t\tuserWorkerName: this.#entry.resolved.main ? this.#entry.name : undefined,\n\t\t\tassets,\n\t\t});\n\t}\n\n\t/** Restarts the Workers when the build's `_headers` or `_redirects` change, since the asset Worker reads them at startup. */\n\tasync #checkAssetRules() {\n\t\tconst previous = this.#assetRules;\n\t\tif (!this.#miniflare || !this.#assets || !previous) {\n\t\t\treturn;\n\t\t}\n\t\tconst current = await this.#assets.readRules();\n\t\tif (current.headers !== previous.headers || current.redirects !== previous.redirects) {\n\t\t\tawait this.#restart('Workers restarted: _headers or _redirects changed');\n\t\t}\n\t}\n\n\tasync #getMiniflareOptions() {\n\t\tconst workers: unknown[] = [];\n\t\tconst externalWorkers: unknown[] = [];\n\t\tconst containers: { config: WorkerConfig; containerOptions: ContainerDevOptions[]; }[] = [];\n\t\tlet assetWorkerOptions: AssetWorkerOptions | undefined;\n\t\tfor (const worker of this.#workers) {\n\t\t\tconst extraBindings = worker === this.#entry ? this.#assetsServiceBinding() : {};\n\t\t\tconst options = await worker.getMiniflareOptions(extraBindings, this.#inspectorPort !== undefined);\n\t\t\tif (worker === this.#entry) {\n\t\t\t\tassetWorkerOptions = options.assetWorkerOptions;\n\t\t\t}\n\t\t\tif (!worker.resolved.main) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tworkers.push(options.worker);\n\t\t\texternalWorkers.push(...options.externalWorkers);\n\t\t\tcontainers.push({ config: worker.resolved.config, containerOptions: options.containerOptions });\n\t\t}\n\t\tconst containerEngine = await this.#prepareContainers(containers);\n\t\tconst assetWorkers = await this.#getAssetWorkers(assetWorkerOptions);\n\n\t\tconst { rootDir } = this.#entry.resolved;\n\t\tconst { persistState = true } = this.#options;\n\t\tlet resourcePersistencePath: string | undefined;\n\t\tif (persistState !== false) {\n\t\t\tconst statePath = typeof persistState === 'object' ? persistState.path : path.join('.wrangler', 'state');\n\t\t\tresourcePersistencePath = path.resolve(rootDir, statePath, 'v3');\n\t\t}\n\n\t\treturn miniflare.convertV4MiniflareOptions({\n\t\t\tlog: new miniflare.Log(miniflare.LogLevel.INFO),\n\t\t\tinspectorPort: this.#inspectorPort,\n\t\t\tresourcePersistencePath,\n\t\t\tresourceTmpPath: path.join(rootDir, '.wrangler', 'tmp'),\n\t\t\tcontainerEngine,\n\t\t\t// lets service bindings reach Workers running in other local dev sessions, and theirs reach these\n\t\t\tunsafeDevRegistryPath: miniflare.getDefaultDevRegistryPath(),\n\t\t\t// serves /cdn-cgi/local/scheduled and friends for testing non-fetch handlers\n\t\t\tunsafeTriggerHandlers: true,\n\t\t\tunsafeModuleFallbackService: (request: Parameters<typeof miniflare.parseModuleFallbackRequest>[0]) => this.#serveHotUpdate(request),\n\t\t\t// the first Worker gets requests without a route override: the entry Worker, or the router for an assets-only project\n\t\t\tworkers: [...workers, ...assetWorkers, ...externalWorkers],\n\t\t} as Parameters<typeof miniflare.convertV4MiniflareOptions>[0]);\n\t}\n\n\t#createDevAssets() {\n\t\tconst { assets } = this.#entry.resolved;\n\t\tconst hooks = this.#hooks;\n\t\tif (!assets || !hooks) {\n\t\t\treturn;\n\t\t}\n\t\treturn new DevAssets({\n\t\t\tdirectory: assets.directory,\n\t\t\t// assets imported by Worker code, which `rspack build` copies into the assets directory\n\t\t\textraDirectories: [this.#entry.importedAssetsDir],\n\t\t\t// the dev server replaces the client compiler's output filesystem with an in-memory one\n\t\t\tgetOutputFileSystem: () => this.#compiler.outputFileSystem as ReadableFileSystem | null ?? undefined,\n\t\t\twaitUntilValid: hooks.waitUntilValid,\n\t\t});\n\t}\n\n\t/** Rebuilds a Worker when its config, a file its config imports, or its local secrets change, like the Vite plugin restarting its server. */\n\t#watchConfigs() {\n\t\tfor (const worker of this.#workers) {\n\t\t\tconst { configFiles, rootDir } = worker.resolved;\n\t\t\tfor (const directory of [rootDir, ...configFiles.map(file => path.dirname(file))]) {\n\t\t\t\tif (!this.#configWatchers.has(directory)) {\n\t\t\t\t\tthis.#configWatchers.set(directory, fs.watch(directory, (_event, fileName) => this.#onConfigDirectoryChange(directory, fileName)));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t#onConfigDirectoryChange(directory: string, fileName: string | null) {\n\t\tif (!fileName) {\n\t\t\treturn;\n\t\t}\n\t\tconst filePath = path.join(directory, fileName);\n\t\tfor (const worker of this.#workers) {\n\t\t\tconst { configFiles, rootDir } = worker.resolved;\n\t\t\tif (configFiles.includes(filePath) || (rootDir === directory && SECRETS_FILE_RE.test(fileName))) {\n\t\t\t\tthis.#scheduleReload(worker);\n\t\t\t}\n\t\t}\n\t}\n\n\t#scheduleReload(worker: DevWorker) {\n\t\tclearTimeout(this.#pendingReloads.get(worker));\n\t\t// editors often write a file in several steps, so wait for them to settle\n\t\tthis.#pendingReloads.set(worker, setTimeout(() => {\n\t\t\tthis.#pendingReloads.delete(worker);\n\t\t\tthis.#reloadWorker(worker).catch((error: unknown) => {\n\t\t\t\tthis.#logger.error(`Worker \"${worker.name}\" failed to reload its config:\\n${String(error)}`);\n\t\t\t});\n\t\t}, 100));\n\t}\n\n\tasync #reloadWorker(worker: DevWorker) {\n\t\tthis.#logger.info(`Worker \"${worker.name}\" config changed; rebuilding`);\n\t\tthis.#openGate();\n\t\ttry {\n\t\t\tawait worker.reload();\n\t\t\tif (worker === this.#entry) {\n\t\t\t\tthis.#assets = this.#createDevAssets();\n\t\t\t}\n\t\t} finally {\n\t\t\t// a config that fails to load keeps the previous build serving, so requests can't be left waiting for a rebuild\n\t\t\tthis.#releaseGateIfIdle();\n\t\t}\n\t\t// the new config can import files from directories nobody is watching yet\n\t\tthis.#watchConfigs();\n\t}\n\n\tasync #upgrade(webSocketServer: WebSocketServer, url: URL, req: IncomingMessage, socket: Duplex, head: Buffer) {\n\t\tconst mf = await this.#ready();\n\t\tif (!mf) {\n\t\t\tsocket.destroy();\n\t\t\treturn;\n\t\t}\n\t\tconst response = await mf.dispatchFetch(url, { method: req.method, headers: [...getRequestHeaders(req)] });\n\t\tconst workerSocket = response.webSocket;\n\t\tif (!workerSocket || socket.destroyed) {\n\t\t\tsocket.destroy();\n\t\t\treturn;\n\t\t}\n\t\twebSocketServer.handleUpgrade(req, socket, head, (clientSocket) => {\n\t\t\tminiflare.coupleWebSocket(clientSocket, workerSocket).catch((error: unknown) => {\n\t\t\t\tthis.#logger.error(`WebSocket to the Worker failed: ${String(error)}`);\n\t\t\t\tclientSocket.terminate();\n\t\t\t});\n\t\t});\n\t}\n\n\t#sendError(res: ServerResponse, error: unknown) {\n\t\tthis.#logger.error(error instanceof Error ? error.stack ?? error.message : String(error));\n\t\tsendErrorPage(res, error);\n\t}\n\n\tasync #start() {\n\t\tthis.#inspectorPort = await resolveInspectorPort(this.#options.inspectorPort);\n\t\tfor (const worker of this.#workers) {\n\t\t\tworker.start();\n\t\t}\n\t\tthis.#watchConfigs();\n\t\tif (this.#workers.every(worker => !worker.building)) {\n\t\t\t// an assets-only project has nothing to build, so the router and asset Workers can start straight away\n\t\t\tthis.#loading = this.#loading.then(() => this.#load());\n\t\t\tawait this.#loading;\n\t\t}\n\t\tthis.#releaseGateIfIdle();\n\t}\n\n\tstart(hooks: DevServerHooks) {\n\t\tthis.#hooks = hooks;\n\t\tthis.#assets = this.#createDevAssets();\n\t\tthis.#compiler.hooks.done.tap(PLUGIN_NAME, () => {\n\t\t\tthis.#loading = this.#loading.then(() => this.#checkAssetRules()).catch((error: unknown) => {\n\t\t\t\tthis.#logger.error(`Workers failed to pick up _headers or _redirects:\\n${String(error)}`);\n\t\t\t});\n\t\t});\n\t\tthis.#start().catch((error: unknown) => {\n\t\t\tthis.#logger.error(`Workers failed to start:\\n${String(error)}`);\n\t\t\tthis.#gate?.release();\n\t\t});\n\t}\n\n\t/** Connect middleware that sends each request through Cloudflare's router Worker, or straight to the Worker without assets. */\n\tasync handle(req: IncomingMessage, res: ServerResponse, next: () => void) {\n\t\tconst url = getRequestUrl(req);\n\t\tif (DEV_SERVER_PATH_RE.test(url.pathname) || url.pathname.startsWith(getLazyCompilationPrefix(this.#compiler))) {\n\t\t\tnext();\n\t\t\treturn;\n\t\t}\n\t\tif (url.pathname === DEBUG_PATH && this.#inspectorPort !== undefined) {\n\t\t\tres.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' });\n\t\t\tres.end(getDebugPageHtml(this.#workers.map(worker => worker.name), this.#inspectorPort));\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\turl.pathname = rewriteLegacyMiniflarePath(url.pathname);\n\t\t\tconst mf = await this.#ready();\n\t\t\tif (!mf) {\n\t\t\t\t// already logged when the build failed, so only the browser needs telling\n\t\t\t\tconst errors = [...this.#failing].map(worker => `Worker \"${worker.name}\":\\n${worker.buildError ?? ''}`);\n\t\t\t\tsendErrorPage(res, `Workers failed to start:\\n${errors.join('\\n\\n')}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst init = createRequestInit(req, res);\n\t\t\tif (this.#assets && !MINIFLARE_PATH_RE.test(url.pathname)) {\n\t\t\t\tinit.headers.push([miniflare.CoreHeaders.ROUTE_OVERRIDE, ROUTER_WORKER_NAME]);\n\t\t\t}\n\t\t\tconst response = await mf.dispatchFetch(url, init);\n\t\t\tsendResponse(res, response);\n\t\t} catch (error) {\n\t\t\tthis.#sendError(res, error);\n\t\t}\n\t}\n\n\t/** Forwards WebSocket upgrades to the Worker, leaving the dev server's own HMR socket alone. */\n\tattachUpgradeHandler(server: Server, devServerSocketPath: string) {\n\t\tif (!this.#entry.resolved.main) {\n\t\t\treturn;\n\t\t}\n\t\tconst webSocketServer = new WebSocketServer({ noServer: true });\n\t\tserver.on('upgrade', (req: IncomingMessage, socket: Duplex, head: Buffer) => {\n\t\t\tconst url = getRequestUrl(req);\n\t\t\tif (url.pathname === devServerSocketPath) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsocket.on('error', () => socket.destroy());\n\t\t\tthis.#upgrade(webSocketServer, url, req, socket, head).catch((error: unknown) => {\n\t\t\t\tthis.#logger.error(`WebSocket upgrade to the Worker failed: ${String(error)}`);\n\t\t\t\tsocket.destroy();\n\t\t\t});\n\t\t});\n\t}\n\n\t/** The entry Worker as its config was last read. */\n\tget entry() {\n\t\treturn this.#entry.resolved;\n\t}\n\n\tasync dispose() {\n\t\tfor (const watcher of this.#configWatchers.values()) {\n\t\t\twatcher.close();\n\t\t}\n\t\tfor (const timeout of this.#pendingReloads.values()) {\n\t\t\tclearTimeout(timeout);\n\t\t}\n\t\tawait Promise.all(this.#workers.map(worker => worker.dispose()));\n\t\tawait this.#miniflare?.dispose();\n\t\tthis.#miniflare = undefined;\n\t\tthis.#removeContainersOnExit();\n\t\tprocess.off('exit', this.#removeContainersOnExit);\n\t}\n}\n","import { spawn } from 'node:child_process';\nimport { createRequire } from 'node:module';\nimport path from 'node:path';\n\nimport { unstable_resolveNamedTunnel } from 'wrangler';\n\nimport type { TunnelOptions, WorkerConfig } from './options.js';\nimport type { ChildProcess } from 'node:child_process';\n\nconst QUICK_TUNNEL_URL_RE = /https:\\/\\/[\\da-z-]+\\.trycloudflare\\.com/;\n// cloudflared logs this once the edge accepts the tunnel, which is when the public URL starts working\nconst CONNECTED_RE = /Registered tunnel connection/;\nconst STARTUP_TIMEOUT_MS = 30000;\n\nexport interface Tunnel {\n\turls: string[];\n\tclose: () => void;\n}\n\nfunction getWranglerBin() {\n\tconst require = createRequire(import.meta.url);\n\treturn path.join(path.dirname(require.resolve('wrangler/package.json')), 'bin', 'wrangler.js');\n}\n\nfunction stopProcessTree(child: ChildProcess) {\n\tif (child.exitCode !== null || child.pid === undefined) {\n\t\treturn;\n\t}\n\tif (process.platform === 'win32') {\n\t\t// Windows has no SIGTERM for wrangler to forward, so cloudflared would outlive it without killing the whole tree\n\t\tspawn('taskkill', ['/pid', String(child.pid), '/t', '/f'], { stdio: 'ignore' });\n\t} else {\n\t\tchild.kill('SIGTERM');\n\t}\n}\n\nfunction waitUntilConnected(child: ChildProcess, isNamed: boolean) {\n\treturn new Promise<string | undefined>((resolve, reject) => {\n\t\tlet output = '';\n\t\tlet quickUrl: string | undefined;\n\t\tlet settled = false;\n\t\tfunction fail(error: Error) {\n\t\t\tif (!settled) {\n\t\t\t\tsettled = true;\n\t\t\t\tstopProcessTree(child);\n\t\t\t\treject(error);\n\t\t\t}\n\t\t}\n\t\tfunction onData(data: Buffer) {\n\t\t\t// only kept for the error message, so a long-running tunnel doesn't keep growing it\n\t\t\tif (output.length < 20000) {\n\t\t\t\toutput += String(data);\n\t\t\t}\n\t\t\tquickUrl ??= QUICK_TUNNEL_URL_RE.exec(output)?.[0];\n\t\t\tif (!settled && CONNECTED_RE.test(output) && (isNamed || quickUrl)) {\n\t\t\t\tsettled = true;\n\t\t\t\tresolve(quickUrl);\n\t\t\t}\n\t\t}\n\t\tAbortSignal.timeout(STARTUP_TIMEOUT_MS).addEventListener('abort', () => {\n\t\t\tfail(new Error(`The tunnel didn't connect within ${STARTUP_TIMEOUT_MS / 1000}s:\\n${output}`));\n\t\t});\n\t\tchild.stdout?.on('data', onData);\n\t\tchild.stderr?.on('data', onData);\n\t\tchild.once('error', fail);\n\t\tchild.once('exit', (code) => {\n\t\t\tfail(new Error(`wrangler tunnel exited with code ${String(code)}:\\n${output}`));\n\t\t});\n\t});\n}\n\n/**\n * Shares the dev server through a Cloudflare Tunnel: a Quick Tunnel on a random trycloudflare.com URL, or a named\n * tunnel whose routes point at the dev server. wrangler runs it, so it downloads and updates cloudflared as needed.\n */\nexport async function startTunnel(options: { origin: URL; tunnel: TunnelOptions; config: WorkerConfig; cwd: string; }): Promise<Tunnel> {\n\tconst { origin, tunnel, config } = options;\n\tconst args = ['tunnel'];\n\tconst env: NodeJS.ProcessEnv = { ...process.env };\n\tlet urls: string[] = [];\n\tif (tunnel.name === undefined) {\n\t\targs.push('quick-start', origin.href, ...(tunnel.allowedMail ?? []).flatMap(mail => ['--allowed-mail', mail]));\n\t\tif (origin.protocol === 'https:') {\n\t\t\t// the dev server's certificate is for the developer's own hostname, never the loopback address cloudflared dials\n\t\t\tenv.NO_TLS_VERIFY = 'true';\n\t\t}\n\t} else {\n\t\tif (tunnel.allowedMail?.length) {\n\t\t\tthrow new Error('`tunnel.allowedMail` only works with Quick Tunnels; protect a named tunnel with Cloudflare Access instead.');\n\t\t}\n\t\t// also checks the tunnel has a route to this dev server, which is the usual setup mistake\n\t\tconst { hostnames } = await unstable_resolveNamedTunnel(tunnel.name, origin, {\n\t\t\taccountId: config.account_id,\n\t\t\tcomplianceRegion: config.compliance_region,\n\t\t});\n\t\turls = hostnames.map(hostname => `https://${hostname}`);\n\t\targs.push('run', tunnel.name);\n\t}\n\n\tconst child = spawn(process.execPath, [getWranglerBin(), ...args], { cwd: options.cwd, env, stdio: ['ignore', 'pipe', 'pipe'] });\n\tconst quickUrl = await waitUntilConnected(child, tunnel.name !== undefined);\n\tif (quickUrl) {\n\t\turls = [quickUrl];\n\t}\n\treturn { urls, close: () => stopProcessTree(child) };\n}\n","import { buildWorkers, copyImportedAssets } from './build.js';\nimport { getWorkerResolvers } from './config.js';\nimport { DevSession } from './dev.js';\nimport { startTunnel } from './tunnel.js';\n\nimport type { ResolvedWorker } from './config.js';\nimport type { CloudflarePluginOptions } from './options.js';\nimport type { Tunnel } from './tunnel.js';\nimport type { Compiler, RspackPluginInstance } from '@rspack/core';\nimport type { RspackDevServer } from '@rspack/dev-server';\nimport type { IncomingMessage, Server, ServerResponse } from 'node:http';\n\nexport type {\n\tAuxiliaryWorkerOptions,\n\tCloudflarePluginOptions,\n\tTunnelOptions,\n\tWorkerConfig,\n\tWorkerConfigCustomizer,\n} from './options.js';\n\nconst PLUGIN_NAME = 'rspack-plugin-cloudflare';\n\n// listen addresses a tunnel can't dial by name, so it reaches the dev server through localhost instead\nconst WILDCARD_HOSTS = new Set(['0.0.0.0', '::', 'local-ip', 'local-ipv4', 'local-ipv6']);\n\nfunction getDevServerOrigin(server: RspackDevServer) {\n\tconst address = server.server?.address();\n\tconst port = typeof address === 'object' && address ? address.port : Number(server.options.port);\n\tconst serverOption = server.options.server;\n\tconst serverType = typeof serverOption === 'object' ? serverOption.type : serverOption;\n\tconst protocol = serverType === undefined || serverType === 'http' ? 'http' : 'https';\n\tconst { host } = server.options;\n\tconst hostname = !host || WILDCARD_HOSTS.has(host) ? 'localhost' : host;\n\treturn new URL(`${protocol}://${hostname}:${port}`);\n}\n\n/** Lets the tunnel's hostnames past the dev server's Host header check. */\nfunction allowHosts(server: RspackDevServer, urls: string[]) {\n\tconst { allowedHosts } = server.options;\n\tif (allowedHosts === 'all') {\n\t\treturn;\n\t}\n\tconst hostnames = urls.map(url => new URL(url).hostname);\n\t// a list keeps what 'auto' allowed, since localhost, IPs and the configured host always pass\n\tif (Array.isArray(allowedHosts)) {\n\t\tserver.options.allowedHosts = [...allowedHosts, ...hostnames];\n\t} else if (allowedHosts && allowedHosts !== 'auto') {\n\t\tserver.options.allowedHosts = [allowedHosts, ...hostnames];\n\t} else {\n\t\tserver.options.allowedHosts = hostnames;\n\t}\n}\n\nfunction getSocketPath(server: RspackDevServer) {\n\tconst socketOptions = server.options.webSocketServer;\n\tif (typeof socketOptions === 'object' && socketOptions && typeof socketOptions.options?.path === 'string') {\n\t\treturn socketOptions.options.path;\n\t}\n\treturn '/ws';\n}\n\nexport class CloudflarePlugin implements RspackPluginInstance {\n\t#tunnel: Tunnel | undefined;\n\treadonly options: CloudflarePluginOptions;\n\n\tconstructor(options: CloudflarePluginOptions = {}) {\n\t\tthis.options = options;\n\t}\n\n\tasync #openTunnel(server: RspackDevServer, session: Promise<DevSession> | undefined, logger: ReturnType<Compiler['getInfrastructureLogger']>) {\n\t\tconst { tunnel: tunnelOption } = this.options;\n\t\tif (!session || !tunnelOption) {\n\t\t\treturn;\n\t\t}\n\t\tconst { entry } = await session;\n\t\tlogger.warn('Starting a Cloudflare Tunnel: anyone with its URL can reach this dev server and its Worker\\'s local bindings.');\n\t\tthis.#tunnel = await startTunnel({\n\t\t\torigin: getDevServerOrigin(server),\n\t\t\ttunnel: tunnelOption === true ? {} : tunnelOption,\n\t\t\tconfig: entry.config,\n\t\t\tcwd: entry.rootDir,\n\t\t});\n\t\tallowHosts(server, this.#tunnel.urls);\n\t\tfor (const url of this.#tunnel.urls) {\n\t\t\tlogger.info(`Tunnel: ${url}`);\n\t\t}\n\t}\n\n\tapply(compiler: Compiler) {\n\t\ttype DevServerOptions = NonNullable<RspackDevServer['options']>;\n\t\tconst logger = compiler.getInfrastructureLogger(PLUGIN_NAME);\n\t\tconst resolvers = getWorkerResolvers(compiler.context, this.options, compiler.options.output.path);\n\t\tlet session: Promise<DevSession> | undefined;\n\n\t\t// `rspack serve` builds the dev server from these options after plugins apply, so wrapping them here hooks us in\n\t\tconst devServer = compiler.options.devServer as DevServerOptions | undefined;\n\t\tif (devServer) {\n\t\t\ttype Middlewares = Parameters<NonNullable<DevServerOptions['setupMiddlewares']>>[0];\n\t\t\tconst { setupMiddlewares, onListening } = devServer;\n\t\t\tdevServer.setupMiddlewares = (middlewares: Middlewares, server: RspackDevServer) => {\n\t\t\t\tconst result = setupMiddlewares ? setupMiddlewares(middlewares, server) : middlewares;\n\t\t\t\tconst activeSession = DevSession.create({ compiler, resolvers, pluginOptions: this.options, logger }).then((created) => {\n\t\t\t\t\tcreated.start({\n\t\t\t\t\t\twaitUntilValid: () => new Promise((resolve) => {\n\t\t\t\t\t\t\tif (server.middleware) {\n\t\t\t\t\t\t\t\tserver.middleware.waitUntilValid(() => resolve());\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tsendToClients: (type, data) => {\n\t\t\t\t\t\t\tif (server.webSocketServer) {\n\t\t\t\t\t\t\t\tserver.sendMessage(server.webSocketServer.clients, type, data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t\treturn created;\n\t\t\t\t});\n\t\t\t\tactiveSession.catch((error: unknown) => {\n\t\t\t\t\tlogger.error(`Workers failed to start:\\n${String(error)}`);\n\t\t\t\t});\n\t\t\t\tsession = activeSession;\n\t\t\t\t// ahead of dev-middleware so `run_worker_first` decides who answers, not whatever the client build emitted\n\t\t\t\tconst devMiddlewareIndex = result.findIndex(middleware => typeof middleware === 'object' && middleware.name === '@rspack/dev-middleware');\n\t\t\t\tresult.splice(devMiddlewareIndex === -1 ? result.length : devMiddlewareIndex, 0, {\n\t\t\t\t\tname: PLUGIN_NAME,\n\t\t\t\t\tmiddleware: (req: IncomingMessage, res: ServerResponse, next: (error?: unknown) => void) => {\n\t\t\t\t\t\tactiveSession.then(created => created.handle(req, res, next)).catch(next);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\treturn result;\n\t\t\t};\n\t\t\tdevServer.onListening = (server: RspackDevServer) => {\n\t\t\t\tconst httpServer = server.server;\n\t\t\t\tif (session && httpServer) {\n\t\t\t\t\t// a session that failed to start has already been logged, and leaves nothing to forward upgrades to\n\t\t\t\t\tsession.then(created => created.attachUpgradeHandler(httpServer as Server, getSocketPath(server))).catch(() => {});\n\t\t\t\t}\n\t\t\t\tif (this.options.tunnel) {\n\t\t\t\t\tthis.#openTunnel(server, session, logger).catch((error: unknown) => {\n\t\t\t\t\t\tlogger.error(`Tunnel failed to start: ${error instanceof Error ? error.message : String(error)}`);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tonListening?.(server);\n\t\t\t};\n\t\t}\n\n\t\t// the Workers `rspack build` bundled, whose imported assets join the client output once it has emitted\n\t\tlet builtWorkers: ResolvedWorker[] | undefined;\n\t\tcompiler.hooks.beforeRun.tapPromise(PLUGIN_NAME, async () => {\n\t\t\tconst workers = await Promise.all(resolvers.map(resolve => resolve()));\n\t\t\tawait buildWorkers({ compiler, workers, pluginOptions: this.options });\n\t\t\tfor (const worker of workers) {\n\t\t\t\tlogger.info(`Built ${worker.main ? 'Worker' : 'assets-only config'} \"${worker.name}\" into ${worker.outputDir}`);\n\t\t\t}\n\t\t\tbuiltWorkers = workers;\n\t\t});\n\t\tcompiler.hooks.afterEmit.tapPromise(PLUGIN_NAME, async () => {\n\t\t\tif (builtWorkers) {\n\t\t\t\tawait copyImportedAssets(builtWorkers);\n\t\t\t}\n\t\t});\n\t\tcompiler.hooks.shutdown.tapPromise(PLUGIN_NAME, async () => {\n\t\t\tthis.#tunnel?.close();\n\t\t\tconst created = await session?.catch(() => {});\n\t\t\tawait created?.dispose();\n\t\t});\n\t}\n}\n\nexport function cloudflare(options?: CloudflarePluginOptions) {\n\treturn new CloudflarePlugin(options);\n}\n"],"ignoreList":[11,12,13,14,15],"mappings":";;;;;;;;;;;;;;;;;;AAOA,MAAM,gBAA0D;CAC/D;EAAE,MAAM;EAAQ,OAAO;GAAC;GAAY;GAAa;EAAU;CAAE;CAC7D;EAAE,MAAM;EAAQ,OAAO,CAAC,UAAU;CAAE;CACpC;EAAE,MAAM;EAAgB,OAAO,CAAC,aAAa,kBAAkB;CAAE;AAClE;AAEA,MAAM,eAAkC;CAAC;CAAgB;CAAQ;AAAM;AAEvE,SAAS,aAAa,MAAkC;CACvD,OAAO,aAAa,SAAS,IAAI;AAClC;;AAGA,SAAgB,eAAe,QAAwB;CACtD,MAAM,wBAAQ,IAAI,IAAwB;CAC1C,KAAK,MAAM,QAAQ,CAAC,GAAG,OAAO,OAAO,OAAO,GAAG,aAAa,GAAG;EAC9D,IAAI,CAAC,aAAa,KAAK,IAAI,GAC1B;EAED,KAAK,MAAM,QAAQ,KAAK,OAAO;GAE9B,MAAM,YAA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