Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove non-standard module export condition #1559

Merged
merged 3 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ function _resolveExportConditions(
}

// 4. Add default conditions
resolvedConditions.push("import", "module", "default");
resolvedConditions.push("import", "default");

// Dedup with preserving order
return resolvedConditions.filter(
Expand Down
3 changes: 1 addition & 2 deletions src/presets/bun.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { resolvePathSync } from "mlly";
import { defineNitroPreset } from "../preset";

export const bun = defineNitroPreset({
extends: "node-server",
entry: "#internal/nitro/entries/bun",
// https://bun.sh/docs/runtime/modules#resolution
exportConditions: ["bun", "worker", "module", "node", "default", "browser"],
exportConditions: ["bun", "worker", "node", "import", "default"],
commands: {
preview: "bun run ./server/index.mjs",
},
Expand Down
2 changes: 1 addition & 1 deletion src/rollup/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,9 @@
conditions: [
"default",
nitro.options.dev ? "development" : "production",
"module",
"node",
"import",
"require",

Check warning on line 361 in src/rollup/config.ts

View check run for this annotation

Codecov / codecov/patch

src/rollup/config.ts#L361

Added line #L361 was not covered by tests
],
}).catch(() => null);
if (_resolved) {
Expand Down