Skip to content

Commit

Permalink
Merge pull request #676 from into-the-v0id/bugfix/esbuild-tests
Browse files Browse the repository at this point in the history
Fix esbuild tests
  • Loading branch information
oscarotero authored Oct 19, 2024
2 parents dd4788b + 4ad1106 commit 04b749e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 68 deletions.
7 changes: 3 additions & 4 deletions plugins/esbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export function esbuild(userOptions?: Options) {

site.addEventListener("beforeSave", stop);

const basePath = options.options.absWorkingDir || site.src();

/** Run esbuild and returns the output files */
const entryContent: Record<string, string> = {};

Expand All @@ -130,6 +132,7 @@ export function esbuild(userOptions?: Options) {
...options.options,
write: false,
metafile: false,
absWorkingDir: basePath,
entryPoints,
sourcemap: enableAllSourceMaps ? "external" : undefined,
outExtension: undefined,
Expand Down Expand Up @@ -225,10 +228,6 @@ export function esbuild(userOptions?: Options) {
return [outputFiles || [], enableAllSourceMaps];
}

// Define default options for splitting mode
options.options.absWorkingDir ||= site.src();
const basePath = options.options.absWorkingDir;

site.process(options.extensions, async (pages, allPages) => {
const [outputFiles, enableSourceMap] = await runEsbuild(pages);
const { outExtension } = options.options;
Expand Down
Loading

0 comments on commit 04b749e

Please sign in to comment.