diff options
author | 2023-06-07 14:38:04 -0700 | |
---|---|---|
committer | 2023-06-07 14:38:04 -0700 | |
commit | 4f2095d1c64467f190ac4f35209ff663bf34f39a (patch) | |
tree | 54869b438cb358dbd418eaa706fe74502f77fe92 | |
parent | cfd68a4e9b819cf5a4f5b7541f965f17bfdeaa21 (diff) | |
download | bun-plugin/resolvedir.tar.gz bun-plugin/resolvedir.tar.zst bun-plugin/resolvedir.zip |
Resolve outbaseplugin/resolvedir
-rw-r--r-- | src/bundler/bundle_v2.zig | 1 | ||||
-rw-r--r-- | test/bundler/bundler_plugin.test.ts | 2 | ||||
-rw-r--r-- | test/bundler/expectBundled.ts | 5 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/bundler/bundle_v2.zig b/src/bundler/bundle_v2.zig index 71c23e723..c62be6153 100644 --- a/src/bundler/bundle_v2.zig +++ b/src/bundler/bundle_v2.zig @@ -1352,7 +1352,6 @@ pub const BundleV2 = struct { _ = @atomicRmw(usize, &this.graph.parse_pending, .Sub, 1, .Monotonic); }, .success => |code| { - this.graph.input_files.items(.loader)[load.source_index.get()] = code.loader; this.graph.input_files.items(.source)[load.source_index.get()].contents = code.source_code; var parse_task = load.parse_task; diff --git a/test/bundler/bundler_plugin.test.ts b/test/bundler/bundler_plugin.test.ts index d2afc3d3f..37e803876 100644 --- a/test/bundler/bundler_plugin.test.ts +++ b/test/bundler/bundler_plugin.test.ts @@ -843,7 +843,7 @@ describe("bundler", () => { build.onResolve({ "filter": /.magic$/ }, args => { console.log({ root, resolveDir: args.resolveDir }); expect(args.resolveDir).toBeDefined(); - expect(args.resolveDir!.replace("/private", "")).toEqual(root); + expect(args.resolveDir).toEqual(root); return { path: "magic", "namespace": "magic", diff --git a/test/bundler/expectBundled.ts b/test/bundler/expectBundled.ts index a5cc344c3..bcd69360d 100644 --- a/test/bundler/expectBundled.ts +++ b/test/bundler/expectBundled.ts @@ -3,6 +3,7 @@ */ import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "fs"; import path from "path"; +import fs from "fs"; import dedent from "dedent"; import { bunEnv, bunExe } from "harness"; import { tmpdir } from "os"; @@ -42,7 +43,7 @@ export const RUN_UNCHECKED_TESTS = false; const outBaseTemplate = path.join(tmpdir(), "bun-build-tests", `${ESBUILD ? "esbuild" : "bun"}-`); if (!existsSync(path.dirname(outBaseTemplate))) mkdirSync(path.dirname(outBaseTemplate), { recursive: true }); -const outBase = mkdtempSync(outBaseTemplate); +const outBase = fs.realpathSync(mkdtempSync(outBaseTemplate)); const testsRan = new Set(); if (ESBUILD) { @@ -410,7 +411,7 @@ function expectBundled( backend = plugins !== undefined ? "api" : "cli"; } - const root = path.join(outBase, id.replaceAll("/", path.sep)); + const root = await path.join(outBase, id.replaceAll("/", path.sep)); if (DEBUG) console.log("root:", root); const entryPaths = entryPoints.map(file => path.join(root, file)); |