Skip to content

Commit

Permalink
Fix issues with CJS interop (#97)
Browse files Browse the repository at this point in the history
* fix: correct import of cjs file

* fix: esbuild plugin asset resolution

* chore: add changeset
  • Loading branch information
rturnq authored Nov 7, 2023
1 parent 396f05b commit 79d62e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/famous-cups-travel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@marko/vite": patch
---

Fix issues with CJS interop and fix esbuild plugin resolution
2 changes: 1 addition & 1 deletion src/esbuild-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default function esbuildPlugin(
return {
namespace: "marko:virtual",
path: path.resolve(args.resolveDir, args.path),
external: isScan,
};
});

Expand All @@ -45,7 +46,6 @@ export default function esbuildPlugin(
(args) => ({
contents: virtualFiles.get(args.path)!.code,
loader: path.extname(args.path).slice(1) as ESBuildLoader,
external: isScan,
})
);

Expand Down
3 changes: 1 addition & 2 deletions src/resolve.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { exports } from "resolve.exports";
import * as Resolve from "resolve";
import type { Opts as ResolveOpts } from "resolve";
import Resolve, { type Opts as ResolveOpts } from "resolve";
import path from "path";
import fs from "fs";

Expand Down

0 comments on commit 79d62e3

Please sign in to comment.