Skip to content

Commit fc6b046

Browse files
committed
🐛 Fix: support q-manifest resolution under Bun runtime (#7565)
Previously, the manifest resolution logic only accounted for Node.js, causing issues when building under Bun. This patch updates the runtime check to include "bun" as well, allowing the server to load the q-manifest correctly during SSR builds in Bun environments.
1 parent 5a97c4a commit fc6b046

File tree

1 file changed

+4
-4
lines changed
  • packages/qwik/src/optimizer/src/plugins

1 file changed

+4
-4
lines changed

packages/qwik/src/optimizer/src/plugins/vite.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {
190190
pluginOpts.input = viteConfig.build?.lib.entry;
191191
}
192192
}
193-
if (sys.env === 'node') {
193+
if (sys.env === 'node' || sys.env === 'bun') {
194194
const fs: typeof import('fs') = await sys.dynamicImport('node:fs');
195195

196196
try {
@@ -552,7 +552,7 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {
552552
);
553553

554554
const sys = qwikPlugin.getSys();
555-
if (tmpClientManifestPath && sys.env === 'node') {
555+
if (tmpClientManifestPath && (sys.env === 'node' || sys.env === 'bun')) {
556556
// Client build should write the manifest to a tmp dir
557557
const fs: typeof import('fs') = await sys.dynamicImport('node:fs');
558558
await fs.promises.writeFile(tmpClientManifestPath, clientManifestStr);
@@ -567,7 +567,7 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {
567567
// ssr build
568568

569569
const sys = qwikPlugin.getSys();
570-
if (sys.env === 'node') {
570+
if (sys.env === 'node' || sys.env === 'bun') {
571571
const outputs = Object.keys(rollupBundle);
572572

573573
// In order to simplify executing the server script with a common script
@@ -781,7 +781,7 @@ const findQwikRoots = async (
781781
packageJsonDir: string
782782
): Promise<QwikPackages[]> => {
783783
const paths = new Map<string, string>();
784-
if (sys.env === 'node') {
784+
if (sys.env === 'node' || sys.env === 'bun') {
785785
const fs: typeof import('fs') = await sys.dynamicImport('node:fs');
786786
let prevPackageJsonDir: string | undefined;
787787
do {

0 commit comments

Comments
 (0)