wxt 0.14.4 → 0.14.5
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/dist/{chunk-LETSPJCU.js → chunk-YECUTQH3.js} +43 -21
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +43 -21
- package/dist/{external-QOQPHF1G.d.cts → external-biT0d3qK.d.cts} +18 -0
- package/dist/{external-QOQPHF1G.d.ts → external-biT0d3qK.d.ts} +18 -0
- package/dist/index.cjs +43 -21
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/testing.cjs +10 -2
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.14.
|
|
2
|
+
var version = "0.14.5";
|
|
3
3
|
|
|
4
4
|
// src/core/utils/arrays.ts
|
|
5
5
|
function every(array, predicate) {
|
|
@@ -1237,6 +1237,7 @@ async function getInternalConfig(inlineConfig, command, server) {
|
|
|
1237
1237
|
const typesDir = path4.resolve(wxtDir, "types");
|
|
1238
1238
|
const outBaseDir = path4.resolve(root, mergedConfig.outDir ?? ".output");
|
|
1239
1239
|
const outDir = path4.resolve(outBaseDir, `${browser}-mv${manifestVersion}`);
|
|
1240
|
+
const reloadCommand = mergedConfig.dev?.reloadCommand ?? "Alt+R";
|
|
1240
1241
|
const runnerConfig = await loadConfig({
|
|
1241
1242
|
name: "web-ext",
|
|
1242
1243
|
cwd: root,
|
|
@@ -1289,7 +1290,10 @@ async function getInternalConfig(inlineConfig, command, server) {
|
|
|
1289
1290
|
experimental: {
|
|
1290
1291
|
includeBrowserPolyfill: mergedConfig.experimental?.includeBrowserPolyfill ?? true
|
|
1291
1292
|
},
|
|
1292
|
-
server
|
|
1293
|
+
server,
|
|
1294
|
+
dev: {
|
|
1295
|
+
reloadCommand
|
|
1296
|
+
}
|
|
1293
1297
|
};
|
|
1294
1298
|
const builder = await createViteBuilder(
|
|
1295
1299
|
inlineConfig,
|
|
@@ -1356,7 +1360,11 @@ function mergeInlineConfig(inlineConfig, userConfig) {
|
|
|
1356
1360
|
...inlineConfig.experimental
|
|
1357
1361
|
},
|
|
1358
1362
|
vite: void 0,
|
|
1359
|
-
transformManifest: void 0
|
|
1363
|
+
transformManifest: void 0,
|
|
1364
|
+
dev: {
|
|
1365
|
+
...userConfig.dev,
|
|
1366
|
+
...inlineConfig.dev
|
|
1367
|
+
}
|
|
1360
1368
|
};
|
|
1361
1369
|
}
|
|
1362
1370
|
function resolveInternalZipConfig(root, mergedConfig) {
|
|
@@ -1768,6 +1776,7 @@ async function writeManifest(manifest, output, config) {
|
|
|
1768
1776
|
});
|
|
1769
1777
|
}
|
|
1770
1778
|
async function generateManifest(entrypoints, buildOutput, config) {
|
|
1779
|
+
const warnings = [];
|
|
1771
1780
|
const pkg = await getPackageJson(config);
|
|
1772
1781
|
let versionName = config.manifest.version_name ?? config.manifest.version ?? pkg?.version;
|
|
1773
1782
|
if (versionName == null) {
|
|
@@ -1785,21 +1794,26 @@ async function generateManifest(entrypoints, buildOutput, config) {
|
|
|
1785
1794
|
short_name: pkg?.shortName,
|
|
1786
1795
|
icons: discoverIcons(buildOutput)
|
|
1787
1796
|
};
|
|
1788
|
-
if (config.command === "serve") {
|
|
1789
|
-
baseManifest.commands = {
|
|
1790
|
-
"wxt:reload-extension": {
|
|
1791
|
-
description: "Reload the extension during development",
|
|
1792
|
-
suggested_key: {
|
|
1793
|
-
default: "Alt+R"
|
|
1794
|
-
}
|
|
1795
|
-
}
|
|
1796
|
-
};
|
|
1797
|
-
}
|
|
1798
1797
|
const userManifest = config.manifest;
|
|
1799
1798
|
const manifest = defu3(
|
|
1800
1799
|
userManifest,
|
|
1801
1800
|
baseManifest
|
|
1802
1801
|
);
|
|
1802
|
+
if (config.command === "serve" && config.dev.reloadCommand) {
|
|
1803
|
+
if (manifest.commands && Object.keys(manifest.commands).length >= 4) {
|
|
1804
|
+
warnings.push([
|
|
1805
|
+
"Extension already has 4 registered commands, WXT's reload command is disabled"
|
|
1806
|
+
]);
|
|
1807
|
+
} else {
|
|
1808
|
+
manifest.commands ??= {};
|
|
1809
|
+
manifest.commands["wxt:reload-extension"] = {
|
|
1810
|
+
description: "Reload the extension during development",
|
|
1811
|
+
suggested_key: {
|
|
1812
|
+
default: config.dev.reloadCommand
|
|
1813
|
+
}
|
|
1814
|
+
};
|
|
1815
|
+
}
|
|
1816
|
+
}
|
|
1803
1817
|
manifest.version = version2;
|
|
1804
1818
|
manifest.version_name = // Firefox doesn't support version_name
|
|
1805
1819
|
config.browser === "firefox" || versionName === version2 ? void 0 : versionName;
|
|
@@ -1818,7 +1832,10 @@ async function generateManifest(entrypoints, buildOutput, config) {
|
|
|
1818
1832
|
"Manifest 'version' is missing. Either:\n1. Add a version in your <rootDir>/package.json\n2. Pass the version via the manifest option in your wxt.config.ts"
|
|
1819
1833
|
);
|
|
1820
1834
|
}
|
|
1821
|
-
return
|
|
1835
|
+
return {
|
|
1836
|
+
manifest: finalManifest,
|
|
1837
|
+
warnings
|
|
1838
|
+
};
|
|
1822
1839
|
}
|
|
1823
1840
|
function simplifyVersion(versionName) {
|
|
1824
1841
|
const version2 = /^((0|[1-9][0-9]{0,8})([.](0|[1-9][0-9]{0,8})){0,3}).*$/.exec(
|
|
@@ -2179,11 +2196,7 @@ async function rebuild(config, allEntrypoints, entrypointGroups, existingOutput
|
|
|
2179
2196
|
steps: [...existingOutput.steps, ...newOutput.steps],
|
|
2180
2197
|
publicAssets: [...existingOutput.publicAssets, ...newOutput.publicAssets]
|
|
2181
2198
|
};
|
|
2182
|
-
const newManifest = await generateManifest(
|
|
2183
|
-
allEntrypoints,
|
|
2184
|
-
mergedOutput,
|
|
2185
|
-
config
|
|
2186
|
-
);
|
|
2199
|
+
const { manifest: newManifest, warnings: manifestWarnings } = await generateManifest(allEntrypoints, mergedOutput, config);
|
|
2187
2200
|
const finalOutput = {
|
|
2188
2201
|
manifest: newManifest,
|
|
2189
2202
|
...newOutput
|
|
@@ -2199,7 +2212,8 @@ async function rebuild(config, allEntrypoints, entrypointGroups, existingOutput
|
|
|
2199
2212
|
...finalOutput.publicAssets
|
|
2200
2213
|
]
|
|
2201
2214
|
},
|
|
2202
|
-
manifest: newManifest
|
|
2215
|
+
manifest: newManifest,
|
|
2216
|
+
warnings: manifestWarnings
|
|
2203
2217
|
};
|
|
2204
2218
|
}
|
|
2205
2219
|
|
|
@@ -2218,13 +2232,21 @@ async function internalBuild(config) {
|
|
|
2218
2232
|
const entrypoints = await findEntrypoints(config);
|
|
2219
2233
|
config.logger.debug("Detected entrypoints:", entrypoints);
|
|
2220
2234
|
const groups = groupEntrypoints(entrypoints);
|
|
2221
|
-
const { output } = await rebuild(
|
|
2235
|
+
const { output, warnings } = await rebuild(
|
|
2236
|
+
config,
|
|
2237
|
+
entrypoints,
|
|
2238
|
+
groups,
|
|
2239
|
+
void 0
|
|
2240
|
+
);
|
|
2222
2241
|
await printBuildSummary(
|
|
2223
2242
|
config.logger.success,
|
|
2224
2243
|
`Built extension in ${formatDuration(Date.now() - startTime)}`,
|
|
2225
2244
|
output,
|
|
2226
2245
|
config
|
|
2227
2246
|
);
|
|
2247
|
+
for (const warning of warnings) {
|
|
2248
|
+
config.logger.warn(...warning);
|
|
2249
|
+
}
|
|
2228
2250
|
if (config.analysis.enabled) {
|
|
2229
2251
|
await combineAnalysisStats(config);
|
|
2230
2252
|
config.logger.info(
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import "./chunk-73I7FAJU.js";
|
|
|
5
5
|
import cac from "cac";
|
|
6
6
|
|
|
7
7
|
// package.json
|
|
8
|
-
var version = "0.14.
|
|
8
|
+
var version = "0.14.5";
|
|
9
9
|
|
|
10
10
|
// src/core/utils/fs.ts
|
|
11
11
|
import fs from "fs-extra";
|
|
@@ -1554,6 +1554,7 @@ async function getInternalConfig(inlineConfig, command, server) {
|
|
|
1554
1554
|
const typesDir = path3.resolve(wxtDir, "types");
|
|
1555
1555
|
const outBaseDir = path3.resolve(root, mergedConfig.outDir ?? ".output");
|
|
1556
1556
|
const outDir = path3.resolve(outBaseDir, `${browser}-mv${manifestVersion}`);
|
|
1557
|
+
const reloadCommand = mergedConfig.dev?.reloadCommand ?? "Alt+R";
|
|
1557
1558
|
const runnerConfig = await loadConfig({
|
|
1558
1559
|
name: "web-ext",
|
|
1559
1560
|
cwd: root,
|
|
@@ -1606,7 +1607,10 @@ async function getInternalConfig(inlineConfig, command, server) {
|
|
|
1606
1607
|
experimental: {
|
|
1607
1608
|
includeBrowserPolyfill: mergedConfig.experimental?.includeBrowserPolyfill ?? true
|
|
1608
1609
|
},
|
|
1609
|
-
server
|
|
1610
|
+
server,
|
|
1611
|
+
dev: {
|
|
1612
|
+
reloadCommand
|
|
1613
|
+
}
|
|
1610
1614
|
};
|
|
1611
1615
|
const builder = await createViteBuilder(
|
|
1612
1616
|
inlineConfig,
|
|
@@ -1673,7 +1677,11 @@ function mergeInlineConfig(inlineConfig, userConfig) {
|
|
|
1673
1677
|
...inlineConfig.experimental
|
|
1674
1678
|
},
|
|
1675
1679
|
vite: void 0,
|
|
1676
|
-
transformManifest: void 0
|
|
1680
|
+
transformManifest: void 0,
|
|
1681
|
+
dev: {
|
|
1682
|
+
...userConfig.dev,
|
|
1683
|
+
...inlineConfig.dev
|
|
1684
|
+
}
|
|
1677
1685
|
};
|
|
1678
1686
|
}
|
|
1679
1687
|
function resolveInternalZipConfig(root, mergedConfig) {
|
|
@@ -2089,6 +2097,7 @@ async function writeManifest(manifest, output, config) {
|
|
|
2089
2097
|
});
|
|
2090
2098
|
}
|
|
2091
2099
|
async function generateManifest(entrypoints, buildOutput, config) {
|
|
2100
|
+
const warnings = [];
|
|
2092
2101
|
const pkg = await getPackageJson(config);
|
|
2093
2102
|
let versionName = config.manifest.version_name ?? config.manifest.version ?? pkg?.version;
|
|
2094
2103
|
if (versionName == null) {
|
|
@@ -2106,21 +2115,26 @@ async function generateManifest(entrypoints, buildOutput, config) {
|
|
|
2106
2115
|
short_name: pkg?.shortName,
|
|
2107
2116
|
icons: discoverIcons(buildOutput)
|
|
2108
2117
|
};
|
|
2109
|
-
if (config.command === "serve") {
|
|
2110
|
-
baseManifest.commands = {
|
|
2111
|
-
"wxt:reload-extension": {
|
|
2112
|
-
description: "Reload the extension during development",
|
|
2113
|
-
suggested_key: {
|
|
2114
|
-
default: "Alt+R"
|
|
2115
|
-
}
|
|
2116
|
-
}
|
|
2117
|
-
};
|
|
2118
|
-
}
|
|
2119
2118
|
const userManifest = config.manifest;
|
|
2120
2119
|
const manifest = defu3(
|
|
2121
2120
|
userManifest,
|
|
2122
2121
|
baseManifest
|
|
2123
2122
|
);
|
|
2123
|
+
if (config.command === "serve" && config.dev.reloadCommand) {
|
|
2124
|
+
if (manifest.commands && Object.keys(manifest.commands).length >= 4) {
|
|
2125
|
+
warnings.push([
|
|
2126
|
+
"Extension already has 4 registered commands, WXT's reload command is disabled"
|
|
2127
|
+
]);
|
|
2128
|
+
} else {
|
|
2129
|
+
manifest.commands ??= {};
|
|
2130
|
+
manifest.commands["wxt:reload-extension"] = {
|
|
2131
|
+
description: "Reload the extension during development",
|
|
2132
|
+
suggested_key: {
|
|
2133
|
+
default: config.dev.reloadCommand
|
|
2134
|
+
}
|
|
2135
|
+
};
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2124
2138
|
manifest.version = version2;
|
|
2125
2139
|
manifest.version_name = // Firefox doesn't support version_name
|
|
2126
2140
|
config.browser === "firefox" || versionName === version2 ? void 0 : versionName;
|
|
@@ -2139,7 +2153,10 @@ async function generateManifest(entrypoints, buildOutput, config) {
|
|
|
2139
2153
|
"Manifest 'version' is missing. Either:\n1. Add a version in your <rootDir>/package.json\n2. Pass the version via the manifest option in your wxt.config.ts"
|
|
2140
2154
|
);
|
|
2141
2155
|
}
|
|
2142
|
-
return
|
|
2156
|
+
return {
|
|
2157
|
+
manifest: finalManifest,
|
|
2158
|
+
warnings
|
|
2159
|
+
};
|
|
2143
2160
|
}
|
|
2144
2161
|
function simplifyVersion(versionName) {
|
|
2145
2162
|
const version2 = /^((0|[1-9][0-9]{0,8})([.](0|[1-9][0-9]{0,8})){0,3}).*$/.exec(
|
|
@@ -2500,11 +2517,7 @@ async function rebuild(config, allEntrypoints, entrypointGroups, existingOutput
|
|
|
2500
2517
|
steps: [...existingOutput.steps, ...newOutput.steps],
|
|
2501
2518
|
publicAssets: [...existingOutput.publicAssets, ...newOutput.publicAssets]
|
|
2502
2519
|
};
|
|
2503
|
-
const newManifest = await generateManifest(
|
|
2504
|
-
allEntrypoints,
|
|
2505
|
-
mergedOutput,
|
|
2506
|
-
config
|
|
2507
|
-
);
|
|
2520
|
+
const { manifest: newManifest, warnings: manifestWarnings } = await generateManifest(allEntrypoints, mergedOutput, config);
|
|
2508
2521
|
const finalOutput = {
|
|
2509
2522
|
manifest: newManifest,
|
|
2510
2523
|
...newOutput
|
|
@@ -2520,7 +2533,8 @@ async function rebuild(config, allEntrypoints, entrypointGroups, existingOutput
|
|
|
2520
2533
|
...finalOutput.publicAssets
|
|
2521
2534
|
]
|
|
2522
2535
|
},
|
|
2523
|
-
manifest: newManifest
|
|
2536
|
+
manifest: newManifest,
|
|
2537
|
+
warnings: manifestWarnings
|
|
2524
2538
|
};
|
|
2525
2539
|
}
|
|
2526
2540
|
|
|
@@ -2539,13 +2553,21 @@ async function internalBuild(config) {
|
|
|
2539
2553
|
const entrypoints = await findEntrypoints(config);
|
|
2540
2554
|
config.logger.debug("Detected entrypoints:", entrypoints);
|
|
2541
2555
|
const groups = groupEntrypoints(entrypoints);
|
|
2542
|
-
const { output } = await rebuild(
|
|
2556
|
+
const { output, warnings } = await rebuild(
|
|
2557
|
+
config,
|
|
2558
|
+
entrypoints,
|
|
2559
|
+
groups,
|
|
2560
|
+
void 0
|
|
2561
|
+
);
|
|
2543
2562
|
await printBuildSummary(
|
|
2544
2563
|
config.logger.success,
|
|
2545
2564
|
`Built extension in ${formatDuration(Date.now() - startTime)}`,
|
|
2546
2565
|
output,
|
|
2547
2566
|
config
|
|
2548
2567
|
);
|
|
2568
|
+
for (const warning of warnings) {
|
|
2569
|
+
config.logger.warn(...warning);
|
|
2570
|
+
}
|
|
2549
2571
|
if (config.analysis.enabled) {
|
|
2550
2572
|
await combineAnalysisStats(config);
|
|
2551
2573
|
config.logger.info(
|
|
@@ -323,6 +323,24 @@ interface InlineConfig {
|
|
|
323
323
|
*/
|
|
324
324
|
includeBrowserPolyfill?: boolean;
|
|
325
325
|
};
|
|
326
|
+
/**
|
|
327
|
+
* Config effecting dev mode only.
|
|
328
|
+
*/
|
|
329
|
+
dev?: {
|
|
330
|
+
/**
|
|
331
|
+
* Controls whether a custom keyboard shortcut command, `Alt+R`, is added during dev mode to
|
|
332
|
+
* quickly reload the extension.
|
|
333
|
+
*
|
|
334
|
+
* If false, the shortcut is not added during development.
|
|
335
|
+
*
|
|
336
|
+
* If set to a custom string, you can override the key combo used. See
|
|
337
|
+
* [Chrome's command docs](https://developer.chrome.com/docs/extensions/reference/api/commands)
|
|
338
|
+
* for available options.
|
|
339
|
+
*
|
|
340
|
+
* @default "Alt+R"
|
|
341
|
+
*/
|
|
342
|
+
reloadCommand?: string | false;
|
|
343
|
+
};
|
|
326
344
|
}
|
|
327
345
|
interface InlineConfig {
|
|
328
346
|
/**
|
|
@@ -323,6 +323,24 @@ interface InlineConfig {
|
|
|
323
323
|
*/
|
|
324
324
|
includeBrowserPolyfill?: boolean;
|
|
325
325
|
};
|
|
326
|
+
/**
|
|
327
|
+
* Config effecting dev mode only.
|
|
328
|
+
*/
|
|
329
|
+
dev?: {
|
|
330
|
+
/**
|
|
331
|
+
* Controls whether a custom keyboard shortcut command, `Alt+R`, is added during dev mode to
|
|
332
|
+
* quickly reload the extension.
|
|
333
|
+
*
|
|
334
|
+
* If false, the shortcut is not added during development.
|
|
335
|
+
*
|
|
336
|
+
* If set to a custom string, you can override the key combo used. See
|
|
337
|
+
* [Chrome's command docs](https://developer.chrome.com/docs/extensions/reference/api/commands)
|
|
338
|
+
* for available options.
|
|
339
|
+
*
|
|
340
|
+
* @default "Alt+R"
|
|
341
|
+
*/
|
|
342
|
+
reloadCommand?: string | false;
|
|
343
|
+
};
|
|
326
344
|
}
|
|
327
345
|
interface InlineConfig {
|
|
328
346
|
/**
|
package/dist/index.cjs
CHANGED
|
@@ -3977,6 +3977,7 @@ async function getInternalConfig(inlineConfig, command, server) {
|
|
|
3977
3977
|
const typesDir = import_node_path7.default.resolve(wxtDir, "types");
|
|
3978
3978
|
const outBaseDir = import_node_path7.default.resolve(root, mergedConfig.outDir ?? ".output");
|
|
3979
3979
|
const outDir = import_node_path7.default.resolve(outBaseDir, `${browser}-mv${manifestVersion}`);
|
|
3980
|
+
const reloadCommand = mergedConfig.dev?.reloadCommand ?? "Alt+R";
|
|
3980
3981
|
const runnerConfig = await (0, import_c12.loadConfig)({
|
|
3981
3982
|
name: "web-ext",
|
|
3982
3983
|
cwd: root,
|
|
@@ -4029,7 +4030,10 @@ async function getInternalConfig(inlineConfig, command, server) {
|
|
|
4029
4030
|
experimental: {
|
|
4030
4031
|
includeBrowserPolyfill: mergedConfig.experimental?.includeBrowserPolyfill ?? true
|
|
4031
4032
|
},
|
|
4032
|
-
server
|
|
4033
|
+
server,
|
|
4034
|
+
dev: {
|
|
4035
|
+
reloadCommand
|
|
4036
|
+
}
|
|
4033
4037
|
};
|
|
4034
4038
|
const builder = await createViteBuilder(
|
|
4035
4039
|
inlineConfig,
|
|
@@ -4096,7 +4100,11 @@ function mergeInlineConfig(inlineConfig, userConfig) {
|
|
|
4096
4100
|
...inlineConfig.experimental
|
|
4097
4101
|
},
|
|
4098
4102
|
vite: void 0,
|
|
4099
|
-
transformManifest: void 0
|
|
4103
|
+
transformManifest: void 0,
|
|
4104
|
+
dev: {
|
|
4105
|
+
...userConfig.dev,
|
|
4106
|
+
...inlineConfig.dev
|
|
4107
|
+
}
|
|
4100
4108
|
};
|
|
4101
4109
|
}
|
|
4102
4110
|
function resolveInternalZipConfig(root, mergedConfig) {
|
|
@@ -4373,7 +4381,7 @@ function getChunkSortWeight(filename) {
|
|
|
4373
4381
|
var import_picocolors4 = __toESM(require("picocolors"), 1);
|
|
4374
4382
|
|
|
4375
4383
|
// package.json
|
|
4376
|
-
var version = "0.14.
|
|
4384
|
+
var version = "0.14.5";
|
|
4377
4385
|
|
|
4378
4386
|
// src/core/utils/log/printHeader.ts
|
|
4379
4387
|
var import_consola2 = require("consola");
|
|
@@ -4514,6 +4522,7 @@ async function writeManifest(manifest, output, config) {
|
|
|
4514
4522
|
});
|
|
4515
4523
|
}
|
|
4516
4524
|
async function generateManifest(entrypoints, buildOutput, config) {
|
|
4525
|
+
const warnings = [];
|
|
4517
4526
|
const pkg = await getPackageJson(config);
|
|
4518
4527
|
let versionName = config.manifest.version_name ?? config.manifest.version ?? pkg?.version;
|
|
4519
4528
|
if (versionName == null) {
|
|
@@ -4531,21 +4540,26 @@ async function generateManifest(entrypoints, buildOutput, config) {
|
|
|
4531
4540
|
short_name: pkg?.shortName,
|
|
4532
4541
|
icons: discoverIcons(buildOutput)
|
|
4533
4542
|
};
|
|
4534
|
-
if (config.command === "serve") {
|
|
4535
|
-
baseManifest.commands = {
|
|
4536
|
-
"wxt:reload-extension": {
|
|
4537
|
-
description: "Reload the extension during development",
|
|
4538
|
-
suggested_key: {
|
|
4539
|
-
default: "Alt+R"
|
|
4540
|
-
}
|
|
4541
|
-
}
|
|
4542
|
-
};
|
|
4543
|
-
}
|
|
4544
4543
|
const userManifest = config.manifest;
|
|
4545
4544
|
const manifest = (0, import_defu3.default)(
|
|
4546
4545
|
userManifest,
|
|
4547
4546
|
baseManifest
|
|
4548
4547
|
);
|
|
4548
|
+
if (config.command === "serve" && config.dev.reloadCommand) {
|
|
4549
|
+
if (manifest.commands && Object.keys(manifest.commands).length >= 4) {
|
|
4550
|
+
warnings.push([
|
|
4551
|
+
"Extension already has 4 registered commands, WXT's reload command is disabled"
|
|
4552
|
+
]);
|
|
4553
|
+
} else {
|
|
4554
|
+
manifest.commands ??= {};
|
|
4555
|
+
manifest.commands["wxt:reload-extension"] = {
|
|
4556
|
+
description: "Reload the extension during development",
|
|
4557
|
+
suggested_key: {
|
|
4558
|
+
default: config.dev.reloadCommand
|
|
4559
|
+
}
|
|
4560
|
+
};
|
|
4561
|
+
}
|
|
4562
|
+
}
|
|
4549
4563
|
manifest.version = version2;
|
|
4550
4564
|
manifest.version_name = // Firefox doesn't support version_name
|
|
4551
4565
|
config.browser === "firefox" || versionName === version2 ? void 0 : versionName;
|
|
@@ -4564,7 +4578,10 @@ async function generateManifest(entrypoints, buildOutput, config) {
|
|
|
4564
4578
|
"Manifest 'version' is missing. Either:\n1. Add a version in your <rootDir>/package.json\n2. Pass the version via the manifest option in your wxt.config.ts"
|
|
4565
4579
|
);
|
|
4566
4580
|
}
|
|
4567
|
-
return
|
|
4581
|
+
return {
|
|
4582
|
+
manifest: finalManifest,
|
|
4583
|
+
warnings
|
|
4584
|
+
};
|
|
4568
4585
|
}
|
|
4569
4586
|
function simplifyVersion(versionName) {
|
|
4570
4587
|
const version2 = /^((0|[1-9][0-9]{0,8})([.](0|[1-9][0-9]{0,8})){0,3}).*$/.exec(
|
|
@@ -4925,11 +4942,7 @@ async function rebuild(config, allEntrypoints, entrypointGroups, existingOutput
|
|
|
4925
4942
|
steps: [...existingOutput.steps, ...newOutput.steps],
|
|
4926
4943
|
publicAssets: [...existingOutput.publicAssets, ...newOutput.publicAssets]
|
|
4927
4944
|
};
|
|
4928
|
-
const newManifest = await generateManifest(
|
|
4929
|
-
allEntrypoints,
|
|
4930
|
-
mergedOutput,
|
|
4931
|
-
config
|
|
4932
|
-
);
|
|
4945
|
+
const { manifest: newManifest, warnings: manifestWarnings } = await generateManifest(allEntrypoints, mergedOutput, config);
|
|
4933
4946
|
const finalOutput = {
|
|
4934
4947
|
manifest: newManifest,
|
|
4935
4948
|
...newOutput
|
|
@@ -4945,7 +4958,8 @@ async function rebuild(config, allEntrypoints, entrypointGroups, existingOutput
|
|
|
4945
4958
|
...finalOutput.publicAssets
|
|
4946
4959
|
]
|
|
4947
4960
|
},
|
|
4948
|
-
manifest: newManifest
|
|
4961
|
+
manifest: newManifest,
|
|
4962
|
+
warnings: manifestWarnings
|
|
4949
4963
|
};
|
|
4950
4964
|
}
|
|
4951
4965
|
|
|
@@ -4964,13 +4978,21 @@ async function internalBuild(config) {
|
|
|
4964
4978
|
const entrypoints = await findEntrypoints(config);
|
|
4965
4979
|
config.logger.debug("Detected entrypoints:", entrypoints);
|
|
4966
4980
|
const groups = groupEntrypoints(entrypoints);
|
|
4967
|
-
const { output } = await rebuild(
|
|
4981
|
+
const { output, warnings } = await rebuild(
|
|
4982
|
+
config,
|
|
4983
|
+
entrypoints,
|
|
4984
|
+
groups,
|
|
4985
|
+
void 0
|
|
4986
|
+
);
|
|
4968
4987
|
await printBuildSummary(
|
|
4969
4988
|
config.logger.success,
|
|
4970
4989
|
`Built extension in ${formatDuration(Date.now() - startTime)}`,
|
|
4971
4990
|
output,
|
|
4972
4991
|
config
|
|
4973
4992
|
);
|
|
4993
|
+
for (const warning of warnings) {
|
|
4994
|
+
config.logger.warn(...warning);
|
|
4995
|
+
}
|
|
4974
4996
|
if (config.analysis.enabled) {
|
|
4975
4997
|
await combineAnalysisStats(config);
|
|
4976
4998
|
config.logger.info(
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-
|
|
2
|
-
export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, x as WxtBuilder, y as WxtBuilderServer, a as WxtViteConfig } from './external-
|
|
1
|
+
import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-biT0d3qK.cjs';
|
|
2
|
+
export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, x as WxtBuilder, y as WxtBuilderServer, a as WxtViteConfig } from './external-biT0d3qK.cjs';
|
|
3
3
|
import 'vite';
|
|
4
4
|
import 'webextension-polyfill';
|
|
5
5
|
import 'unimport';
|
|
@@ -62,6 +62,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
|
|
|
62
62
|
*/
|
|
63
63
|
declare function zip(config?: InlineConfig): Promise<string[]>;
|
|
64
64
|
|
|
65
|
-
var version = "0.14.
|
|
65
|
+
var version = "0.14.5";
|
|
66
66
|
|
|
67
67
|
export { BuildOutput, ExtensionRunnerConfig, InlineConfig, UserConfig, WxtDevServer, build, clean, createServer, defineConfig, defineRunnerConfig, initialize, prepare, version, zip };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-
|
|
2
|
-
export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, x as WxtBuilder, y as WxtBuilderServer, a as WxtViteConfig } from './external-
|
|
1
|
+
import { I as InlineConfig, B as BuildOutput, U as UserConfig, E as ExtensionRunnerConfig, W as WxtDevServer } from './external-biT0d3qK.js';
|
|
2
|
+
export { q as BackgroundDefinition, h as BackgroundEntrypoint, g as BaseEntrypoint, f as BaseEntrypointOptions, d as BuildStepOutput, w as ConfigEnv, p as ContentScriptBaseDefinition, m as ContentScriptDefinition, C as ContentScriptEntrypoint, n as ContentScriptIsolatedWorldDefinition, o as ContentScriptMainWorldDefinition, j as Entrypoint, k as EntrypointGroup, t as ExcludableEntrypoint, G as GenericEntrypoint, L as Logger, l as OnContentScriptStopped, i as OptionsEntrypoint, c as OutputAsset, b as OutputChunk, O as OutputFile, s as PerBrowserOption, P as PopupEntrypoint, S as ServerInfo, T as TargetBrowser, e as TargetManifestVersion, r as UnlistedScriptDefinition, u as UserManifest, v as UserManifestFn, x as WxtBuilder, y as WxtBuilderServer, a as WxtViteConfig } from './external-biT0d3qK.js';
|
|
3
3
|
import 'vite';
|
|
4
4
|
import 'webextension-polyfill';
|
|
5
5
|
import 'unimport';
|
|
@@ -62,6 +62,6 @@ declare function prepare(config: InlineConfig): Promise<void>;
|
|
|
62
62
|
*/
|
|
63
63
|
declare function zip(config?: InlineConfig): Promise<string[]>;
|
|
64
64
|
|
|
65
|
-
var version = "0.14.
|
|
65
|
+
var version = "0.14.5";
|
|
66
66
|
|
|
67
67
|
export { BuildOutput, ExtensionRunnerConfig, InlineConfig, UserConfig, WxtDevServer, build, clean, createServer, defineConfig, defineRunnerConfig, initialize, prepare, version, zip };
|
package/dist/index.js
CHANGED
package/dist/testing.cjs
CHANGED
|
@@ -961,6 +961,7 @@ async function getInternalConfig(inlineConfig, command, server) {
|
|
|
961
961
|
const typesDir = import_node_path7.default.resolve(wxtDir, "types");
|
|
962
962
|
const outBaseDir = import_node_path7.default.resolve(root, mergedConfig.outDir ?? ".output");
|
|
963
963
|
const outDir = import_node_path7.default.resolve(outBaseDir, `${browser}-mv${manifestVersion}`);
|
|
964
|
+
const reloadCommand = mergedConfig.dev?.reloadCommand ?? "Alt+R";
|
|
964
965
|
const runnerConfig = await (0, import_c12.loadConfig)({
|
|
965
966
|
name: "web-ext",
|
|
966
967
|
cwd: root,
|
|
@@ -1013,7 +1014,10 @@ async function getInternalConfig(inlineConfig, command, server) {
|
|
|
1013
1014
|
experimental: {
|
|
1014
1015
|
includeBrowserPolyfill: mergedConfig.experimental?.includeBrowserPolyfill ?? true
|
|
1015
1016
|
},
|
|
1016
|
-
server
|
|
1017
|
+
server,
|
|
1018
|
+
dev: {
|
|
1019
|
+
reloadCommand
|
|
1020
|
+
}
|
|
1017
1021
|
};
|
|
1018
1022
|
const builder = await createViteBuilder(
|
|
1019
1023
|
inlineConfig,
|
|
@@ -1080,7 +1084,11 @@ function mergeInlineConfig(inlineConfig, userConfig) {
|
|
|
1080
1084
|
...inlineConfig.experimental
|
|
1081
1085
|
},
|
|
1082
1086
|
vite: void 0,
|
|
1083
|
-
transformManifest: void 0
|
|
1087
|
+
transformManifest: void 0,
|
|
1088
|
+
dev: {
|
|
1089
|
+
...userConfig.dev,
|
|
1090
|
+
...inlineConfig.dev
|
|
1091
|
+
}
|
|
1084
1092
|
};
|
|
1085
1093
|
}
|
|
1086
1094
|
function resolveInternalZipConfig(root, mergedConfig) {
|
package/dist/testing.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { FakeBrowser, fakeBrowser } from '@webext-core/fake-browser';
|
|
2
2
|
import * as vite from 'vite';
|
|
3
|
-
import { I as InlineConfig } from './external-
|
|
3
|
+
import { I as InlineConfig } from './external-biT0d3qK.cjs';
|
|
4
4
|
import 'webextension-polyfill';
|
|
5
5
|
import 'unimport';
|
|
6
6
|
import 'consola';
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { FakeBrowser, fakeBrowser } from '@webext-core/fake-browser';
|
|
2
2
|
import * as vite from 'vite';
|
|
3
|
-
import { I as InlineConfig } from './external-
|
|
3
|
+
import { I as InlineConfig } from './external-biT0d3qK.js';
|
|
4
4
|
import 'webextension-polyfill';
|
|
5
5
|
import 'unimport';
|
|
6
6
|
import 'consola';
|
package/dist/testing.js
CHANGED