Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/wxt/e2e/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ export class TestProject {
return fs.exists(this.resolvePath(...path));
}

async getOutputManifest(
getOutputManifest(
path: string = '.output/chrome-mv3/manifest.json',
): Promise<any> {
return await fs.readJson(this.resolvePath(path));
return fs.readJson(this.resolvePath(path));
}
}
2 changes: 1 addition & 1 deletion packages/wxt/src/core/builders/vite/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ async function moveHtmlFiles(
);

// TODO: Optimize and only delete old path directories
removeEmptyDirs(config.outDir);
await removeEmptyDirs(config.outDir);

return movedChunks;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/wxt/src/core/builders/vite/plugins/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ export function download(config: ResolvedConfig): Plugin {
resolveId(id) {
if (id.startsWith('url:')) return '\0' + id;
},
async load(id) {
load(id) {
if (!id.startsWith('\0url:')) return;

// Load file from network or cache
const url = id.replace('\0url:', '');
return await fetchCached(url, config);
return fetchCached(url, config);
},
};
}
2 changes: 1 addition & 1 deletion packages/wxt/src/core/runners/web-ext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function createWebExtRunner(): ExtensionRunner {
},

async closeBrowser() {
return await runner?.exit();
await runner?.exit();
},
};
}
Expand Down
3 changes: 1 addition & 2 deletions packages/wxt/src/core/utils/building/find-entrypoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,7 @@ async function importEntrypoints(infos: EntrypointInfo[]) {
await Promise.all([
// HTML
...htmlInfos.map(async (info) => {
const res = await importHtmlEntrypoint(info);
resMap[info.inputPath] = res;
resMap[info.inputPath] = await importHtmlEntrypoint(info);
}),
// JS
(async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/wxt/src/core/utils/building/internal-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export async function internalBuild(): Promise<BuildOutput> {
} else {
wxt.logger.info(`Opening ${pc.yellow(statsPath)} in browser...`);
const { default: open } = await import('open');
open(wxt.config.analysis.outputFile);
await open(wxt.config.analysis.outputFile);
}
}
}
Expand Down
8 changes: 1 addition & 7 deletions packages/wxt/src/core/utils/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@ import { withTimeout } from './time';

function isOffline(): Promise<boolean> {
const isOffline = new Promise<boolean>((res) => {
dns.resolve('google.com', (err) => {
if (err == null) {
res(false);
} else {
res(true);
}
});
dns.resolve('google.com', (err) => res(err != null));
});
return withTimeout(isOffline, 1e3).catch(() => true);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/wxt/src/utils/content-script-ui/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ function autoMountUi(
}
}
}
observeElement(resolvedAnchor);
void observeElement(resolvedAnchor);

return { stopAutoMount: _stopAutoMount };
}
Loading