wxt 0.18.15 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/wxt.mjs +1 -1
- package/dist/browser/chrome.d.ts +17 -0
- package/dist/browser/chrome.mjs +7 -0
- package/dist/browser/index.d.ts +18 -0
- package/dist/browser/index.mjs +2 -0
- package/dist/builtin-modules/index.d.ts +2 -0
- package/dist/builtin-modules/index.mjs +2 -0
- package/dist/builtin-modules/unimport.d.ts +8 -0
- package/dist/builtin-modules/unimport.mjs +99 -0
- package/dist/cli/cli-utils.d.ts +25 -0
- package/dist/cli/cli-utils.mjs +58 -0
- package/dist/cli/commands.d.ts +2 -0
- package/dist/cli/commands.mjs +104 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.mjs +11 -0
- package/dist/client/app-config.d.ts +2 -0
- package/dist/client/app-config.mjs +4 -0
- package/dist/client/content-scripts/content-script-context.d.ts +114 -0
- package/dist/client/content-scripts/content-script-context.mjs +169 -0
- package/dist/client/content-scripts/custom-events.d.ts +10 -0
- package/dist/client/content-scripts/custom-events.mjs +13 -0
- package/dist/client/content-scripts/index.d.ts +2 -0
- package/dist/client/content-scripts/index.mjs +2 -0
- package/dist/client/content-scripts/location-watcher.d.ts +12 -0
- package/dist/client/content-scripts/location-watcher.mjs +22 -0
- package/dist/client/content-scripts/ui/index.d.ts +23 -0
- package/dist/client/content-scripts/ui/index.mjs +188 -0
- package/dist/{client.d.ts → client/content-scripts/ui/types.d.ts} +17 -45
- package/dist/client/content-scripts/ui/types.mjs +0 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/index.mjs +2 -0
- package/dist/core/build.d.ts +15 -0
- package/dist/core/build.mjs +6 -0
- package/dist/core/builders/vite/index.d.ts +3 -0
- package/dist/core/builders/vite/index.mjs +285 -0
- package/dist/core/builders/vite/plugins/bundleAnalysis.d.ts +7 -0
- package/dist/core/builders/vite/plugins/bundleAnalysis.mjs +15 -0
- package/dist/core/builders/vite/plugins/cssEntrypoints.d.ts +13 -0
- package/dist/core/builders/vite/plugins/cssEntrypoints.mjs +22 -0
- package/dist/core/builders/vite/plugins/defineImportMeta.d.ts +14 -0
- package/dist/core/builders/vite/plugins/defineImportMeta.mjs +13 -0
- package/dist/core/builders/vite/plugins/devHtmlPrerender.d.ts +7 -0
- package/dist/core/builders/vite/plugins/devHtmlPrerender.mjs +140 -0
- package/dist/core/builders/vite/plugins/devServerGlobals.d.ts +6 -0
- package/dist/core/builders/vite/plugins/devServerGlobals.mjs +15 -0
- package/dist/core/builders/vite/plugins/download.d.ts +10 -0
- package/dist/core/builders/vite/plugins/download.mjs +14 -0
- package/dist/core/builders/vite/plugins/entrypointGroupGlobals.d.ts +6 -0
- package/dist/core/builders/vite/plugins/entrypointGroupGlobals.mjs +16 -0
- package/dist/core/builders/vite/plugins/extensionApiMock.d.ts +11 -0
- package/dist/core/builders/vite/plugins/extensionApiMock.mjs +26 -0
- package/dist/core/builders/vite/plugins/globals.d.ts +3 -0
- package/dist/core/builders/vite/plugins/globals.mjs +15 -0
- package/dist/core/builders/vite/plugins/index.d.ts +17 -0
- package/dist/core/builders/vite/plugins/index.mjs +17 -0
- package/dist/core/builders/vite/plugins/multipageMove.d.ts +20 -0
- package/dist/core/builders/vite/plugins/multipageMove.mjs +59 -0
- package/dist/core/builders/vite/plugins/noopBackground.d.ts +6 -0
- package/dist/core/builders/vite/plugins/noopBackground.mjs +17 -0
- package/dist/core/builders/vite/plugins/removeEntrypointMainFunction.d.ts +6 -0
- package/dist/core/builders/vite/plugins/removeEntrypointMainFunction.mjs +12 -0
- package/dist/core/builders/vite/plugins/resolveAppConfig.d.ts +6 -0
- package/dist/core/builders/vite/plugins/resolveAppConfig.mjs +26 -0
- package/dist/core/builders/vite/plugins/resolveExtensionApi.d.ts +10 -0
- package/dist/core/builders/vite/plugins/resolveExtensionApi.mjs +15 -0
- package/dist/core/builders/vite/plugins/resolveVirtualModules.d.ts +6 -0
- package/dist/core/builders/vite/plugins/resolveVirtualModules.mjs +30 -0
- package/dist/core/builders/vite/plugins/tsconfigPaths.d.ts +3 -0
- package/dist/core/builders/vite/plugins/tsconfigPaths.mjs +12 -0
- package/dist/core/builders/vite/plugins/wxtPluginLoader.d.ts +6 -0
- package/dist/core/builders/vite/plugins/wxtPluginLoader.mjs +56 -0
- package/dist/core/clean.d.ts +21 -0
- package/dist/core/clean.mjs +38 -0
- package/dist/core/create-server.d.ts +11 -0
- package/dist/core/create-server.mjs +206 -0
- package/dist/core/define-config.d.ts +2 -0
- package/dist/core/define-config.mjs +3 -0
- package/dist/core/define-runner-config.d.ts +2 -0
- package/dist/core/define-runner-config.mjs +3 -0
- package/dist/core/index.d.ts +8 -0
- package/dist/core/index.mjs +8 -0
- package/dist/core/initialize.d.ts +5 -0
- package/dist/core/initialize.mjs +128 -0
- package/dist/core/package-managers/bun.d.ts +2 -0
- package/dist/core/package-managers/bun.mjs +19 -0
- package/dist/core/package-managers/index.d.ts +2 -0
- package/dist/core/package-managers/index.mjs +65 -0
- package/dist/core/package-managers/npm.d.ts +17 -0
- package/dist/core/package-managers/npm.mjs +58 -0
- package/dist/core/package-managers/pnpm.d.ts +2 -0
- package/dist/core/package-managers/pnpm.mjs +21 -0
- package/dist/core/package-managers/types.d.ts +2 -0
- package/dist/core/package-managers/types.mjs +0 -0
- package/dist/core/package-managers/yarn.d.ts +2 -0
- package/dist/core/package-managers/yarn.mjs +31 -0
- package/dist/core/prepare.d.ts +2 -0
- package/dist/core/prepare.mjs +8 -0
- package/dist/core/runners/index.d.ts +2 -0
- package/dist/core/runners/index.mjs +12 -0
- package/dist/core/runners/manual.d.ts +5 -0
- package/dist/core/runners/manual.mjs +16 -0
- package/dist/core/runners/safari.d.ts +5 -0
- package/dist/core/runners/safari.mjs +16 -0
- package/dist/core/runners/web-ext.d.ts +5 -0
- package/dist/core/runners/web-ext.mjs +78 -0
- package/dist/core/runners/wsl.d.ts +5 -0
- package/dist/core/runners/wsl.mjs +16 -0
- package/dist/core/utils/arrays.d.ts +13 -0
- package/dist/{chunk-BERPNPEZ.js → core/utils/arrays.mjs} +6 -10
- package/dist/core/utils/building/build-entrypoints.d.ts +3 -0
- package/dist/core/utils/building/build-entrypoints.mjs +47 -0
- package/dist/core/utils/building/detect-dev-changes.d.ts +57 -0
- package/dist/core/utils/building/detect-dev-changes.mjs +93 -0
- package/dist/core/utils/building/find-entrypoints.d.ts +5 -0
- package/dist/core/utils/building/find-entrypoints.mjs +385 -0
- package/dist/core/utils/building/generate-wxt-dir.d.ts +5 -0
- package/dist/core/utils/building/generate-wxt-dir.mjs +192 -0
- package/dist/core/utils/building/group-entrypoints.d.ts +8 -0
- package/dist/core/utils/building/group-entrypoints.mjs +37 -0
- package/dist/core/utils/building/import-entrypoint.d.ts +16 -0
- package/dist/core/utils/building/import-entrypoint.mjs +97 -0
- package/dist/core/utils/building/index.d.ts +9 -0
- package/dist/core/utils/building/index.mjs +9 -0
- package/dist/core/utils/building/internal-build.d.ts +12 -0
- package/dist/core/utils/building/internal-build.mjs +112 -0
- package/dist/core/utils/building/rebuild.d.ts +23 -0
- package/dist/core/utils/building/rebuild.mjs +39 -0
- package/dist/core/utils/building/resolve-config.d.ts +11 -0
- package/dist/core/utils/building/resolve-config.mjs +364 -0
- package/dist/core/utils/cache.d.ts +8 -0
- package/dist/core/utils/cache.mjs +21 -0
- package/dist/core/utils/cli.d.ts +3 -0
- package/dist/core/utils/cli.mjs +26 -0
- package/dist/core/utils/constants.d.ts +5 -0
- package/dist/core/utils/constants.mjs +1 -0
- package/dist/core/utils/content-scripts.d.ts +11 -0
- package/dist/core/utils/content-scripts.mjs +60 -0
- package/dist/core/utils/content-security-policy.d.ts +14 -0
- package/dist/core/utils/content-security-policy.mjs +39 -0
- package/dist/core/utils/entrypoints.d.ts +25 -0
- package/dist/core/utils/entrypoints.mjs +31 -0
- package/dist/core/utils/eslint.d.ts +1 -0
- package/dist/core/utils/eslint.mjs +11 -0
- package/dist/core/utils/fs.d.ts +13 -0
- package/dist/core/utils/fs.mjs +15 -0
- package/dist/core/utils/globals.d.ts +11 -0
- package/dist/core/utils/globals.mjs +53 -0
- package/dist/core/utils/i18n.d.ts +11 -0
- package/dist/core/utils/i18n.mjs +35 -0
- package/dist/core/utils/log/index.d.ts +4 -0
- package/dist/core/utils/log/index.mjs +4 -0
- package/dist/core/utils/log/printBuildSummary.d.ts +2 -0
- package/dist/core/utils/log/printBuildSummary.mjs +32 -0
- package/dist/core/utils/log/printFileList.d.ts +1 -0
- package/dist/core/utils/log/printFileList.mjs +42 -0
- package/dist/core/utils/log/printHeader.d.ts +1 -0
- package/dist/core/utils/log/printHeader.mjs +7 -0
- package/dist/core/utils/log/printTable.d.ts +1 -0
- package/dist/core/utils/log/printTable.mjs +22 -0
- package/dist/core/utils/manifest.d.ts +44 -0
- package/dist/core/utils/manifest.mjs +512 -0
- package/dist/core/utils/network.d.ts +7 -0
- package/dist/core/utils/network.mjs +38 -0
- package/dist/core/utils/package.d.ts +6 -0
- package/dist/core/utils/package.mjs +14 -0
- package/dist/core/utils/paths.d.ts +11 -0
- package/dist/core/utils/paths.mjs +10 -0
- package/dist/core/utils/strings.d.ts +14 -0
- package/dist/core/utils/strings.mjs +18 -0
- package/dist/core/utils/testing/fake-objects.d.ts +4556 -0
- package/dist/core/utils/testing/fake-objects.mjs +322 -0
- package/dist/core/utils/time.d.ts +9 -0
- package/dist/core/utils/time.mjs +17 -0
- package/dist/core/utils/transform.d.ts +9 -0
- package/dist/core/utils/transform.mjs +17 -0
- package/dist/core/utils/types.d.ts +10 -0
- package/dist/core/utils/types.mjs +0 -0
- package/dist/core/utils/validation.d.ts +15 -0
- package/dist/core/utils/validation.mjs +55 -0
- package/dist/core/utils/virtual-modules.d.ts +22 -0
- package/dist/core/utils/virtual-modules.mjs +14 -0
- package/dist/core/utils/wsl.d.ts +4 -0
- package/dist/core/utils/wsl.mjs +4 -0
- package/dist/core/wxt.d.ts +19 -0
- package/dist/core/wxt.mjs +41 -0
- package/dist/core/zip.d.ts +7 -0
- package/dist/core/zip.mjs +137 -0
- package/dist/index.d.ts +4 -79
- package/dist/index.mjs +3 -0
- package/dist/modules.d.ts +10 -20
- package/dist/{chunk-6XSIWUWF.js → modules.mjs} +7 -16
- package/dist/sandbox/define-app-config.d.ts +19 -0
- package/dist/sandbox/define-app-config.mjs +3 -0
- package/dist/sandbox/define-background.d.ts +3 -0
- package/dist/sandbox/define-background.mjs +4 -0
- package/dist/sandbox/define-content-script.d.ts +2 -0
- package/dist/sandbox/define-content-script.mjs +3 -0
- package/dist/sandbox/define-unlisted-script.d.ts +3 -0
- package/dist/sandbox/define-unlisted-script.mjs +4 -0
- package/dist/sandbox/define-wxt-plugin.d.ts +2 -0
- package/dist/sandbox/define-wxt-plugin.mjs +3 -0
- package/dist/sandbox/dev-server-websocket.d.ts +21 -0
- package/dist/sandbox/dev-server-websocket.mjs +37 -0
- package/dist/sandbox/index.d.ts +11 -0
- package/dist/sandbox/index.mjs +6 -0
- package/dist/sandbox/utils/logger.d.ts +9 -0
- package/dist/sandbox/utils/logger.mjs +15 -0
- package/dist/storage.d.ts +39 -16
- package/dist/{storage.js → storage.mjs} +30 -41
- package/dist/testing/fake-browser.d.ts +1 -0
- package/dist/testing/fake-browser.mjs +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.mjs +2 -0
- package/dist/{testing.d.ts → testing/wxt-vitest-plugin.d.ts} +3 -15
- package/dist/testing/wxt-vitest-plugin.mjs +26 -0
- package/dist/{index-nWRfwAJi.d.cts → types.d.ts} +150 -264
- package/dist/types.mjs +0 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.mjs +1 -0
- package/dist/virtual/{background-entrypoint.js → background-entrypoint.mjs} +31 -40
- package/dist/virtual/{content-script-isolated-world-entrypoint.js → content-script-isolated-world-entrypoint.mjs} +9 -13
- package/dist/virtual/{content-script-main-world-entrypoint.js → content-script-main-world-entrypoint.mjs} +9 -14
- package/dist/virtual/mock-browser.mjs +6 -0
- package/dist/virtual/{reload-html.js → reload-html.mjs} +8 -9
- package/dist/virtual/{unlisted-script-entrypoint.js → unlisted-script-entrypoint.mjs} +8 -12
- package/package.json +47 -57
- package/dist/browser.d.ts +0 -18
- package/dist/browser.js +0 -6
- package/dist/chunk-BM6QYGAW.js +0 -1063
- package/dist/chunk-FNTE2L27.js +0 -7
- package/dist/chunk-FP7RYLVL.js +0 -3617
- package/dist/chunk-KPD5J7PZ.js +0 -1065
- package/dist/chunk-QGM4M3NI.js +0 -37
- package/dist/chunk-SGKCDMVR.js +0 -38
- package/dist/cli.d.ts +0 -2
- package/dist/cli.js +0 -4438
- package/dist/client.js +0 -424
- package/dist/define-app-config-bg54F_lV.d.ts +0 -294
- package/dist/execa-4UBDUBJZ.js +0 -7244
- package/dist/execa-QLUM2B3W.js +0 -7245
- package/dist/index-nWRfwAJi.d.ts +0 -1401
- package/dist/index.cjs +0 -14473
- package/dist/index.d.cts +0 -81
- package/dist/index.js +0 -696
- package/dist/modules.cjs +0 -96
- package/dist/modules.d.cts +0 -119
- package/dist/modules.js +0 -17
- package/dist/prompt-25QIVJDC.js +0 -755
- package/dist/prompt-7BMKNSWS.js +0 -754
- package/dist/sandbox.d.ts +0 -16
- package/dist/sandbox.js +0 -36
- package/dist/storage.cjs +0 -439
- package/dist/storage.d.cts +0 -200
- package/dist/testing.cjs +0 -2815
- package/dist/testing.d.cts +0 -30
- package/dist/testing.js +0 -40
- package/dist/virtual/mock-browser.js +0 -6
package/dist/modules.cjs
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/modules.ts
|
|
31
|
-
var modules_exports = {};
|
|
32
|
-
__export(modules_exports, {
|
|
33
|
-
addEntrypoint: () => addEntrypoint,
|
|
34
|
-
addImportPreset: () => addImportPreset,
|
|
35
|
-
addPublicAssets: () => addPublicAssets,
|
|
36
|
-
addViteConfig: () => addViteConfig,
|
|
37
|
-
addWxtPlugin: () => addWxtPlugin,
|
|
38
|
-
defineWxtModule: () => defineWxtModule
|
|
39
|
-
});
|
|
40
|
-
module.exports = __toCommonJS(modules_exports);
|
|
41
|
-
var vite = __toESM(require("vite"), 1);
|
|
42
|
-
var import_fast_glob = __toESM(require("fast-glob"), 1);
|
|
43
|
-
var import_node_path = require("path");
|
|
44
|
-
function defineWxtModule(module2) {
|
|
45
|
-
if (typeof module2 === "function") return { setup: module2 };
|
|
46
|
-
return module2;
|
|
47
|
-
}
|
|
48
|
-
function addEntrypoint(wxt, entrypoint) {
|
|
49
|
-
wxt.hooks.hook("entrypoints:resolved", (wxt2, entrypoints) => {
|
|
50
|
-
entrypoints.push(entrypoint);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
function addPublicAssets(wxt, dir) {
|
|
54
|
-
wxt.hooks.hook("build:publicAssets", async (wxt2, files) => {
|
|
55
|
-
const moreFiles = await (0, import_fast_glob.default)("**/*", { cwd: dir });
|
|
56
|
-
if (moreFiles.length === 0) {
|
|
57
|
-
wxt2.logger.warn("No files to copy in", dir);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
moreFiles.forEach((file) => {
|
|
61
|
-
files.unshift({ absoluteSrc: (0, import_node_path.resolve)(dir, file), relativeDest: file });
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
function addViteConfig(wxt, viteConfig) {
|
|
66
|
-
wxt.hooks.hook("ready", (wxt2) => {
|
|
67
|
-
const userVite = wxt2.config.vite;
|
|
68
|
-
wxt2.config.vite = async (env) => {
|
|
69
|
-
const fromUser = await userVite(env);
|
|
70
|
-
const fromModule = viteConfig(env) ?? {};
|
|
71
|
-
return vite.mergeConfig(fromModule, fromUser);
|
|
72
|
-
};
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function addWxtPlugin(wxt, plugin) {
|
|
76
|
-
wxt.hooks.hook("ready", (wxt2) => {
|
|
77
|
-
wxt2.config.plugins.push(plugin);
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function addImportPreset(wxt, preset) {
|
|
81
|
-
wxt.hooks.hook("ready", (wxt2) => {
|
|
82
|
-
if (!wxt2.config.imports) return;
|
|
83
|
-
wxt2.config.imports.presets ??= [];
|
|
84
|
-
if (wxt2.config.imports.presets.includes(preset)) return;
|
|
85
|
-
wxt2.config.imports.presets.push(preset);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
-
0 && (module.exports = {
|
|
90
|
-
addEntrypoint,
|
|
91
|
-
addImportPreset,
|
|
92
|
-
addPublicAssets,
|
|
93
|
-
addViteConfig,
|
|
94
|
-
addWxtPlugin,
|
|
95
|
-
defineWxtModule
|
|
96
|
-
});
|
package/dist/modules.d.cts
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { a6 as WxtModuleOptions, a8 as WxtModule, a7 as WxtModuleSetup, Y as Wxt, r as Entrypoint } from './index-nWRfwAJi.cjs';
|
|
2
|
-
import * as vite from 'vite';
|
|
3
|
-
import { UnimportOptions } from 'unimport';
|
|
4
|
-
import 'webextension-polyfill';
|
|
5
|
-
import 'consola';
|
|
6
|
-
import '@aklinker1/rollup-plugin-visualizer';
|
|
7
|
-
import 'chokidar';
|
|
8
|
-
import 'c12';
|
|
9
|
-
import 'hookable';
|
|
10
|
-
import 'nypm';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Utilities for creating reusable, build-time modules for WXT.
|
|
14
|
-
*
|
|
15
|
-
* @module wxt/modules
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
declare function defineWxtModule<TOptions extends WxtModuleOptions>(module: WxtModule<TOptions> | WxtModuleSetup<TOptions>): WxtModule<TOptions>;
|
|
19
|
-
/**
|
|
20
|
-
* Adds a TS/JS file as an entrypoint to the project. This file will be bundled
|
|
21
|
-
* along with the other entrypoints.
|
|
22
|
-
|
|
23
|
-
* If you're publishing the module to NPM, you should probably pre-build the
|
|
24
|
-
* entrypoint and use `addPublicAssets` instead to copy pre-bundled assets into
|
|
25
|
-
* the output directory. This will speed up project builds since it just has to
|
|
26
|
-
* copy some files instead of bundling them.
|
|
27
|
-
*
|
|
28
|
-
* @param wxt The wxt instance provided by the module's setup function.
|
|
29
|
-
* @param entrypoint The entrypoint to be bundled along with the extension.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* export default defineWxtModule((wxt, options) => {
|
|
33
|
-
* addEntrypoint(wxt, {
|
|
34
|
-
* type: "unlisted-page",
|
|
35
|
-
* name: "changelog",
|
|
36
|
-
* inputPath: "wxt-module-changelog/index.html"
|
|
37
|
-
* outputDir: wxt.config.outputDir,
|
|
38
|
-
* options: {},
|
|
39
|
-
* });
|
|
40
|
-
* });
|
|
41
|
-
*/
|
|
42
|
-
declare function addEntrypoint(wxt: Wxt, entrypoint: Entrypoint): void;
|
|
43
|
-
/**
|
|
44
|
-
* Copy files inside a directory (as if it were the public directory) into the
|
|
45
|
-
* extension's output directory. The directory itself is not copied, just the
|
|
46
|
-
* files inside it. If a filename matches an existing one, it is ignored.
|
|
47
|
-
*
|
|
48
|
-
* @param wxt The wxt instance provided by the module's setup function.
|
|
49
|
-
* @param dir The directory to copy.
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* export default defineWxtModule((wxt, options) => {
|
|
53
|
-
* addPublicAssets(wxt, "./dist/prebundled");
|
|
54
|
-
* });
|
|
55
|
-
*/
|
|
56
|
-
declare function addPublicAssets(wxt: Wxt, dir: string): void;
|
|
57
|
-
/**
|
|
58
|
-
* Merge additional vite config for one or more entrypoint "groups" that make
|
|
59
|
-
* up individual builds. Config in the project's `wxt.config.ts` file takes
|
|
60
|
-
* precedence over any config added by this function.
|
|
61
|
-
*
|
|
62
|
-
* @param wxt The wxt instance provided by the module's setup function.
|
|
63
|
-
* @param viteConfig A function that returns the vite config the module is
|
|
64
|
-
adding. Same format as `vite` in `wxt.config.ts`.
|
|
65
|
-
*
|
|
66
|
-
* @example
|
|
67
|
-
* export default defineWxtModule((wxt, options) => {
|
|
68
|
-
* addViteConfig(wxt, () => ({
|
|
69
|
-
* build: {
|
|
70
|
-
* sourceMaps: true,
|
|
71
|
-
* },
|
|
72
|
-
* });
|
|
73
|
-
* });
|
|
74
|
-
*/
|
|
75
|
-
declare function addViteConfig(wxt: Wxt, viteConfig: (env: vite.ConfigEnv) => vite.UserConfig | undefined): void;
|
|
76
|
-
/**
|
|
77
|
-
* Add a runtime plugin to the project. In each entrypoint, before executing
|
|
78
|
-
* the `main` function, plugins are executed.
|
|
79
|
-
*
|
|
80
|
-
* @param wxt The wxt instance provided by the module's setup function.
|
|
81
|
-
* @param plugin An import from an NPM module, or an absolute file path to the
|
|
82
|
-
* file to load at runtime.
|
|
83
|
-
*
|
|
84
|
-
* @example
|
|
85
|
-
* export default defineWxtModule((wxt) => {
|
|
86
|
-
* addWxtPlugin(wxt, "wxt-module-analytics/client-plugin");
|
|
87
|
-
* });
|
|
88
|
-
*/
|
|
89
|
-
declare function addWxtPlugin(wxt: Wxt, plugin: string): void;
|
|
90
|
-
/**
|
|
91
|
-
* Add an Unimport preset ([built-in](https://github.com/unjs/unimport?tab=readme-ov-file#built-in-presets),
|
|
92
|
-
* [custom](https://github.com/unjs/unimport?tab=readme-ov-file#custom-presets),
|
|
93
|
-
* or [auto-scanned](https://github.com/unjs/unimport?tab=readme-ov-file#exports-auto-scan)),
|
|
94
|
-
* to the project's list of auto-imported utilities.
|
|
95
|
-
*
|
|
96
|
-
* Some things to note:
|
|
97
|
-
* - This function will only de-duplicate built-in preset names. It will not
|
|
98
|
-
* stop you adding duplicate custom or auto-scanned presets.
|
|
99
|
-
* - If the project has disabled imports, this function has no effect.
|
|
100
|
-
*
|
|
101
|
-
* @param wxt The wxt instance provided by the module's setup function.
|
|
102
|
-
* @param preset The preset to add to the project.
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* export default defineWxtModule((wxt) => {
|
|
106
|
-
* // Built-in preset:
|
|
107
|
-
* addImportPreset(wxt, "vue");
|
|
108
|
-
* // Custom preset:
|
|
109
|
-
* addImportPreset(wxt, {
|
|
110
|
-
* from: "vue",
|
|
111
|
-
* imports: ["ref", "reactive", ...],
|
|
112
|
-
* });
|
|
113
|
-
* // Auto-scanned preset:
|
|
114
|
-
* addImportPreset(wxt, { package: "vue" });
|
|
115
|
-
* });
|
|
116
|
-
*/
|
|
117
|
-
declare function addImportPreset(wxt: Wxt, preset: UnimportOptions['presets'][0]): void;
|
|
118
|
-
|
|
119
|
-
export { WxtModule, addEntrypoint, addImportPreset, addPublicAssets, addViteConfig, addWxtPlugin, defineWxtModule };
|
package/dist/modules.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
addEntrypoint,
|
|
3
|
-
addImportPreset,
|
|
4
|
-
addPublicAssets,
|
|
5
|
-
addViteConfig,
|
|
6
|
-
addWxtPlugin,
|
|
7
|
-
defineWxtModule
|
|
8
|
-
} from "./chunk-6XSIWUWF.js";
|
|
9
|
-
import "./chunk-QGM4M3NI.js";
|
|
10
|
-
export {
|
|
11
|
-
addEntrypoint,
|
|
12
|
-
addImportPreset,
|
|
13
|
-
addPublicAssets,
|
|
14
|
-
addViteConfig,
|
|
15
|
-
addWxtPlugin,
|
|
16
|
-
defineWxtModule
|
|
17
|
-
};
|