{"record":{"id":"d8d829c2f3ad83be","repo":"sveltejs/kit","slug":"precompress-is-ignored-with-buildoptions-compile","errorCode":null,"errorMessage":"precompress is ignored with buildOptions.compile: embedded assets are imported by identity path","messagePattern":"precompress is ignored with buildOptions\\.compile: embedded assets are imported by identity path","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/adapter-bun/index.js","lineNumber":126,"sourceCode":"\t\tserverOptions = {},\n\t\tbuildOptions = {}\n\t} = opts;\n\n\treturn {\n\t\tname: '@sveltejs/adapter-bun',\n\t\tasync adapt(builder) {\n\t\t\tif (typeof Bun === 'undefined') {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t'adapter-bun requires running the SvelteKit build with Bun. Use `bun run --bun build`.'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tfs.rmSync(out, { recursive: true, force: true });\n\n\t\t\tbuilder.log.minor('Building server');\n\n\t\t\tif (precompress && buildOptions.compile) {\n\t\t\t\tbuilder.log.warn(\n\t\t\t\t\t'precompress is ignored with buildOptions.compile: embedded assets are imported by identity path'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst server = builder.getServerDirectory();\n\n\t\t\tconst src_dir = path.resolve(import.meta.dirname, 'src');\n\t\t\tconst index_file = path.resolve(src_dir, 'index.js');\n\t\t\tconst routes_file = path.resolve(src_dir, 'routes.js');\n\t\t\tconst manifest_file = path.resolve(server, 'manifest.js');\n\t\t\tconst server_options_file = path.resolve(src_dir, 'options.js');\n\n\t\t\tconst tmp = builder.getBuildDirectory('bun-tmp');\n\t\t\tfs.mkdirSync(tmp, { recursive: true });\n\t\t\tbuilder.generateServerInstance(`${tmp}/server.js`);\n\n\t\t\tconst virtual_files = {\n\t\t\t\t[manifest_file]:","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/sveltejs/kit/blob/03f1687fe612ce3d2d9131139b5b188d9cf90c64/packages/adapter-bun/index.js#L108-L144","documentation":"The Bun adapter can embed server assets via `buildOptions.compile` (bundling them by identity path into the executable), which makes precompression pointless. When both `precompress: true` and `buildOptions.compile` are set, this warning tells you the precompress setting is ignored.","triggerScenarios":"In svelte.config.js adapter-bun options, setting `precompress: true` together with `buildOptions.compile: true`, then running the adapt/build step.","commonSituations":"Enabling precompress by habit from other adapters while also enabling Bun's single-file executable compile; migrating config from adapter-node to adapter-bun without pruning options.","solutions":["Remove `precompress: true` (it does nothing with compile) or set it to false","If you need precompressed assets, disable `buildOptions.compile` so assets are emitted as files","Ignore the warning if the behavior (no precompress) is acceptable"],"exampleFix":"// before\nadapter({ precompress: true, buildOptions: { compile: true } })\n// after\nadapter({ buildOptions: { compile: true } })","handlingStrategy":"validation","validationCode":"// validate adapter options before build\nfunction validateBunAdapterOptions(opts) {\n  if (opts.precompress && opts.buildOptions?.compile) {\n    console.warn('precompress will be ignored because buildOptions.compile is enabled');\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't combine precompress with buildOptions.compile","Drop options copied from adapter-node when migrating to adapter-bun","Read adapter README for mutually exclusive options"],"tags":["adapter-bun","precompress","config","build"],"backgroundTag":"ignored-config-option","analyzedSha":"03f1687fe612ce3d2d9131139b5b188d9cf90c64","analyzedAt":"2026-09-02T02:01:50.504Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}