Skip to content

Commit eea91cc

Browse files
authored
Merge pull request #7669 from siguici/fix-bun
🐛 Fix: support q-manifest resolution under Bun runtime (#7565)
2 parents 5a97c4a + 2cf3ef1 commit eea91cc

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/shiny-lies-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@builder.io/qwik': patch
3+
---
4+
5+
fix(ssr): support q-manifest resolution under Bun runtime (#7565)

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)