Skip to content

Commit

Permalink
Merge branch 'main' into feat/isolated-decl
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Jul 2, 2024
2 parents 662f0b8 + 0cabd3c commit 895eda3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export async function build(
rootDir = resolve(process.cwd(), rootDir || ".");

// Create jiti instance for loading initial config
const jiti = createJiti(rootDir);
const jiti = createJiti(rootDir, { interopDefault: true });

const _buildConfig: BuildConfig | BuildConfig[] =
(await jiti.import("./build.config", { try: true })) || {};
Expand Down Expand Up @@ -157,7 +157,7 @@ async function _build(
options.outDir = resolve(options.rootDir, options.outDir);

// Create shared jiti instance for context
const jiti = createJiti(options.rootDir, options.stubOptions.jiti);
const jiti = createJiti(options.rootDir, { interopDefault: true });

// Build context
const ctx: BuildContext = {
Expand Down
6 changes: 3 additions & 3 deletions src/builders/rollup/build.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { OutputOptions, OutputChunk, PreRenderedChunk } from "rollup";
import type { OutputOptions, OutputChunk } from "rollup";
import { rollup } from "rollup";
import dts from "rollup-plugin-dts";
import { resolve, relative } from "pathe";
import type { BuildContext, RollupOptions } from "../../types";
import { resolve } from "pathe";
import type { BuildContext } from "../../types";
import { removeShebangPlugin } from "./plugins/shebang";
import consola from "consola";
import { getRollupOptions } from "./config";
Expand Down
4 changes: 3 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export async function resolvePreset(
if (preset === "auto") {
preset = autoPreset;
} else if (typeof preset === "string") {
preset = (await createJiti(rootDir).import(preset)) || {};
preset =
(await createJiti(rootDir, { interopDefault: true }).import(preset)) ||
{};
}
if (typeof preset === "function") {
preset = preset();
Expand Down

0 comments on commit 895eda3

Please sign in to comment.