extension-develop 3.14.1 → 3.14.2-canary.281.9f4638a
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/{144.cjs → 740.cjs} +17 -37
- package/dist/module.cjs +128 -68
- package/dist/preview.cjs +2 -2
- package/package.json +1 -1
package/dist/{144.cjs → 740.cjs}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
exports.ids = [
|
|
3
|
-
"
|
|
3
|
+
"740"
|
|
4
4
|
];
|
|
5
5
|
exports.modules = {
|
|
6
6
|
"./dev-server/compiler-hooks.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
@@ -824,30 +824,10 @@ exports.modules = {
|
|
|
824
824
|
}
|
|
825
825
|
};
|
|
826
826
|
}
|
|
827
|
-
|
|
828
|
-
const CANONICAL_CONTENT_SCRIPT_ENTRY_PREFIX = "content_scripts/content-";
|
|
829
|
-
function getCanonicalContentScriptEntryName(index) {
|
|
830
|
-
return `${CANONICAL_CONTENT_SCRIPT_ENTRY_PREFIX}${index}`;
|
|
831
|
-
}
|
|
832
|
-
function getCanonicalContentScriptJsAssetName(index) {
|
|
833
|
-
return `${getCanonicalContentScriptEntryName(index)}.js`;
|
|
834
|
-
}
|
|
835
|
-
function getCanonicalContentScriptCssAssetName(index) {
|
|
836
|
-
return `${getCanonicalContentScriptEntryName(index)}.css`;
|
|
837
|
-
}
|
|
838
|
-
function parseCanonicalContentScriptAsset(assetName) {
|
|
839
|
-
const match = /^content_scripts\/content-(\d+)(?:\.[a-f0-9]+)?\.(js|css)$/i.exec(String(assetName || ''));
|
|
840
|
-
if (!match) return;
|
|
841
|
-
const index = Number(match[1]);
|
|
842
|
-
if (!Number.isInteger(index)) return;
|
|
843
|
-
return {
|
|
844
|
-
index,
|
|
845
|
-
extension: match[2]
|
|
846
|
-
};
|
|
847
|
-
}
|
|
827
|
+
var contracts = __webpack_require__("./plugin-web-extension/feature-scripts/contracts.ts");
|
|
848
828
|
function isBundledContentPath(filePath, ext) {
|
|
849
829
|
const normalized = String(filePath || '').replace(/\\/g, '/');
|
|
850
|
-
const bundledAsset =
|
|
830
|
+
const bundledAsset = (0, contracts.es)(normalized);
|
|
851
831
|
return bundledAsset?.extension === ext;
|
|
852
832
|
}
|
|
853
833
|
function isAlreadyBundledContentScripts(contentScripts) {
|
|
@@ -881,7 +861,7 @@ exports.modules = {
|
|
|
881
861
|
result.push({
|
|
882
862
|
...rest,
|
|
883
863
|
js: [
|
|
884
|
-
getFilename(
|
|
864
|
+
getFilename((0, contracts.f6)(bridgeIndex), 'main-world-bridge.js')
|
|
885
865
|
],
|
|
886
866
|
css: []
|
|
887
867
|
});
|
|
@@ -889,10 +869,10 @@ exports.modules = {
|
|
|
889
869
|
result.push({
|
|
890
870
|
...original[index] || {},
|
|
891
871
|
js: [
|
|
892
|
-
...new Set(contentJs.map((js)=>getFilename(
|
|
872
|
+
...new Set(contentJs.map((js)=>getFilename((0, contracts.f6)(index), js)))
|
|
893
873
|
],
|
|
894
874
|
css: [
|
|
895
|
-
...new Set(contentCss.map((css)=>getFilename(
|
|
875
|
+
...new Set(contentCss.map((css)=>getFilename((0, contracts.J4)(index), css)))
|
|
896
876
|
]
|
|
897
877
|
});
|
|
898
878
|
}
|
|
@@ -3051,7 +3031,7 @@ exports.modules = {
|
|
|
3051
3031
|
] : [];
|
|
3052
3032
|
const hasReactRefreshLoader = uses.some((useEntry)=>String(useEntry?.loader || '').includes('react-refresh-loader'));
|
|
3053
3033
|
if (hasReactRefreshLoader) rule.issuerLayer = {
|
|
3054
|
-
not:
|
|
3034
|
+
not: contracts.$t
|
|
3055
3035
|
};
|
|
3056
3036
|
if (Array.isArray(rule.oneOf)) this.patchReactRefreshRules(rule.oneOf);
|
|
3057
3037
|
if (Array.isArray(rule.rules)) this.patchReactRefreshRules(rule.rules);
|
|
@@ -3180,7 +3160,7 @@ exports.modules = {
|
|
|
3180
3160
|
const swcRules = [
|
|
3181
3161
|
{
|
|
3182
3162
|
...swcRuleBase,
|
|
3183
|
-
layer:
|
|
3163
|
+
layer: contracts.$t,
|
|
3184
3164
|
include: (resourcePath)=>Array.from(new Set([
|
|
3185
3165
|
tsRoot,
|
|
3186
3166
|
...swcIncludeDirs
|
|
@@ -3204,8 +3184,8 @@ exports.modules = {
|
|
|
3204
3184
|
},
|
|
3205
3185
|
{
|
|
3206
3186
|
...swcRuleBase,
|
|
3207
|
-
issuerLayer:
|
|
3208
|
-
layer:
|
|
3187
|
+
issuerLayer: contracts.$t,
|
|
3188
|
+
layer: contracts.$t,
|
|
3209
3189
|
use: {
|
|
3210
3190
|
...swcLoaderBase,
|
|
3211
3191
|
options: {
|
|
@@ -3226,7 +3206,7 @@ exports.modules = {
|
|
|
3226
3206
|
{
|
|
3227
3207
|
...swcRuleBase,
|
|
3228
3208
|
issuerLayer: {
|
|
3229
|
-
not:
|
|
3209
|
+
not: contracts.$t
|
|
3230
3210
|
},
|
|
3231
3211
|
exclude: [
|
|
3232
3212
|
...swcRuleBase.exclude,
|
|
@@ -3408,7 +3388,7 @@ exports.modules = {
|
|
|
3408
3388
|
};
|
|
3409
3389
|
}
|
|
3410
3390
|
function resolveDevContentScriptDeclaredPath(declaredPath, _groupIndex, ext, assetNames) {
|
|
3411
|
-
const parsed =
|
|
3391
|
+
const parsed = (0, contracts.es)(declaredPath);
|
|
3412
3392
|
if (!parsed || parsed.extension !== ext) return declaredPath;
|
|
3413
3393
|
const hashed = findHashedContentScriptAsset(assetNames, parsed.index, ext);
|
|
3414
3394
|
return hashed || declaredPath;
|
|
@@ -5675,7 +5655,7 @@ exports.modules = {
|
|
|
5675
5655
|
external_path_.dirname(this.manifestPath)
|
|
5676
5656
|
],
|
|
5677
5657
|
issuerLayer: {
|
|
5678
|
-
not:
|
|
5658
|
+
not: contracts.$t
|
|
5679
5659
|
},
|
|
5680
5660
|
exclude: [
|
|
5681
5661
|
/([\\/])node_modules\1/,
|
|
@@ -5816,7 +5796,7 @@ exports.modules = {
|
|
|
5816
5796
|
const cs = contentScripts[i];
|
|
5817
5797
|
if (cs?.world !== 'MAIN') continue;
|
|
5818
5798
|
const bridgeIndex = originalCount + bridgeOrdinal++;
|
|
5819
|
-
bridgeScripts[
|
|
5799
|
+
bridgeScripts[(0, contracts.Y0)(bridgeIndex)] = bridgeSource;
|
|
5820
5800
|
}
|
|
5821
5801
|
} catch {}
|
|
5822
5802
|
return bridgeScripts;
|
|
@@ -5969,7 +5949,7 @@ exports.modules = {
|
|
|
5969
5949
|
} : {
|
|
5970
5950
|
import: finalEntryImports,
|
|
5971
5951
|
...isContentScriptFeature(feature) || isScriptsFolderFeature(feature) ? {
|
|
5972
|
-
layer:
|
|
5952
|
+
layer: contracts.$t
|
|
5973
5953
|
} : {}
|
|
5974
5954
|
};
|
|
5975
5955
|
}
|
|
@@ -7349,11 +7329,11 @@ Set background.noDynamicEntryWarning to true to disable this warning.
|
|
|
7349
7329
|
let bridgeOrdinal = 0;
|
|
7350
7330
|
for(let i = 0; i < csList.length; i++){
|
|
7351
7331
|
const cs = csList[i];
|
|
7352
|
-
const bundleId =
|
|
7332
|
+
const bundleId = (0, contracts.f6)(i);
|
|
7353
7333
|
const isMain = cs?.world === 'MAIN';
|
|
7354
7334
|
if (isMain) {
|
|
7355
7335
|
const bridgeIndex = originalCount + bridgeOrdinal++;
|
|
7356
|
-
const bridgeBundleId =
|
|
7336
|
+
const bridgeBundleId = (0, contracts.f6)(bridgeIndex);
|
|
7357
7337
|
contentScriptsMeta[bundleId] = {
|
|
7358
7338
|
index: i,
|
|
7359
7339
|
bundleId,
|
package/dist/module.cjs
CHANGED
|
@@ -2149,6 +2149,36 @@ var __webpack_modules__ = {
|
|
|
2149
2149
|
};
|
|
2150
2150
|
}
|
|
2151
2151
|
},
|
|
2152
|
+
"./plugin-web-extension/feature-scripts/contracts.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
2153
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
2154
|
+
$t: ()=>EXTENSIONJS_CONTENT_SCRIPT_LAYER,
|
|
2155
|
+
J4: ()=>getCanonicalContentScriptCssAssetName,
|
|
2156
|
+
Y0: ()=>getCanonicalContentScriptEntryName,
|
|
2157
|
+
es: ()=>parseCanonicalContentScriptAsset,
|
|
2158
|
+
f6: ()=>getCanonicalContentScriptJsAssetName
|
|
2159
|
+
});
|
|
2160
|
+
const EXTENSIONJS_CONTENT_SCRIPT_LAYER = "extensionjs-content-script";
|
|
2161
|
+
const CANONICAL_CONTENT_SCRIPT_ENTRY_PREFIX = "content_scripts/content-";
|
|
2162
|
+
function getCanonicalContentScriptEntryName(index) {
|
|
2163
|
+
return `${CANONICAL_CONTENT_SCRIPT_ENTRY_PREFIX}${index}`;
|
|
2164
|
+
}
|
|
2165
|
+
function getCanonicalContentScriptJsAssetName(index) {
|
|
2166
|
+
return `${getCanonicalContentScriptEntryName(index)}.js`;
|
|
2167
|
+
}
|
|
2168
|
+
function getCanonicalContentScriptCssAssetName(index) {
|
|
2169
|
+
return `${getCanonicalContentScriptEntryName(index)}.css`;
|
|
2170
|
+
}
|
|
2171
|
+
function parseCanonicalContentScriptAsset(assetName) {
|
|
2172
|
+
const match = /^content_scripts\/content-(\d+)(?:\.[a-f0-9]+)?\.(js|css)$/i.exec(String(assetName || ''));
|
|
2173
|
+
if (!match) return;
|
|
2174
|
+
const index = Number(match[1]);
|
|
2175
|
+
if (!Number.isInteger(index)) return;
|
|
2176
|
+
return {
|
|
2177
|
+
index,
|
|
2178
|
+
extension: match[2]
|
|
2179
|
+
};
|
|
2180
|
+
}
|
|
2181
|
+
},
|
|
2152
2182
|
"@rspack/core" (module) {
|
|
2153
2183
|
module.exports = require("@rspack/core");
|
|
2154
2184
|
},
|
|
@@ -2216,7 +2246,7 @@ var __webpack_modules__ = {
|
|
|
2216
2246
|
module.exports = require("webpack-merge");
|
|
2217
2247
|
},
|
|
2218
2248
|
"./package.json" (module) {
|
|
2219
|
-
module.exports = JSON.parse('{"rE":"3.14.
|
|
2249
|
+
module.exports = JSON.parse('{"rE":"3.14.2-canary.281.9f4638a","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^1.7.5","@rspack/dev-server":"^1.2.1","@rspack/plugin-preact-refresh":"1.1.4","@rspack/plugin-react-refresh":"1.6.0","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","@vue/compiler-sfc":"3.5.26","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","extension-from-store":"^0.1.1","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.5.1","less-loader":"12.3.0","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.6","postcss-loader":"8.2.0","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","react-refresh":"0.18.0","sass-loader":"16.0.6","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","typescript":"5.9.3","unique-names-generator":"^4.7.1","vue":"3.5.26","vue-loader":"17.4.2","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3"}}');
|
|
2220
2250
|
}
|
|
2221
2251
|
};
|
|
2222
2252
|
var __webpack_module_cache__ = {};
|
|
@@ -2894,7 +2924,7 @@ var __webpack_exports__ = {};
|
|
|
2894
2924
|
Promise.resolve(require1('@rspack/core')),
|
|
2895
2925
|
import("webpack-merge"),
|
|
2896
2926
|
__webpack_require__.e("750").then(__webpack_require__.bind(__webpack_require__, "./lib/stats-handler.ts")),
|
|
2897
|
-
__webpack_require__.e("
|
|
2927
|
+
__webpack_require__.e("740").then(__webpack_require__.bind(__webpack_require__, "./rspack-config.ts"))
|
|
2898
2928
|
]);
|
|
2899
2929
|
const debug = isAuthor;
|
|
2900
2930
|
if (projectStructure.packageJsonPath) assertNoManagedDependencyConflicts(projectStructure.packageJsonPath, manifestDir);
|
|
@@ -3008,7 +3038,9 @@ var __webpack_exports__ = {};
|
|
|
3008
3038
|
}
|
|
3009
3039
|
}
|
|
3010
3040
|
}
|
|
3041
|
+
var sanitize = __webpack_require__("./lib/sanitize.ts");
|
|
3011
3042
|
const external_node_events_namespaceObject = require("node:events");
|
|
3043
|
+
var contracts = __webpack_require__("./plugin-web-extension/feature-scripts/contracts.ts");
|
|
3012
3044
|
function _define_property(obj, key, value) {
|
|
3013
3045
|
if (key in obj) Object.defineProperty(obj, key, {
|
|
3014
3046
|
value: value,
|
|
@@ -3024,21 +3056,18 @@ var __webpack_exports__ = {};
|
|
|
3024
3056
|
class BrowsersPlugin {
|
|
3025
3057
|
apply(compiler) {
|
|
3026
3058
|
let pendingReloadReason;
|
|
3059
|
+
let pendingChangedSources = [];
|
|
3027
3060
|
compiler.hooks.watchRun.tap(BrowsersPlugin.name, ()=>{
|
|
3028
3061
|
pendingReloadReason = void 0;
|
|
3062
|
+
pendingChangedSources = [];
|
|
3029
3063
|
const modifiedFiles = compiler.modifiedFiles;
|
|
3030
3064
|
if (!modifiedFiles || 0 === modifiedFiles.size) return;
|
|
3065
|
+
const contextDir = compiler.options.context || '';
|
|
3031
3066
|
for (const file of modifiedFiles){
|
|
3032
|
-
const
|
|
3033
|
-
|
|
3034
|
-
if (normalized.includes('manifest.json'))
|
|
3035
|
-
|
|
3036
|
-
return;
|
|
3037
|
-
}
|
|
3038
|
-
if (normalized.includes('_locales/')) {
|
|
3039
|
-
pendingReloadReason = 'full';
|
|
3040
|
-
return;
|
|
3041
|
-
}
|
|
3067
|
+
const normalized = external_path_.relative(contextDir, file).replace(/\\/g, '/');
|
|
3068
|
+
pendingChangedSources.push(normalized);
|
|
3069
|
+
if (normalized.includes('manifest.json')) pendingReloadReason = 'full';
|
|
3070
|
+
else if (normalized.includes('_locales/')) pendingReloadReason = 'full';
|
|
3042
3071
|
}
|
|
3043
3072
|
});
|
|
3044
3073
|
compiler.hooks.done.tapPromise(BrowsersPlugin.name, async (stats)=>{
|
|
@@ -3053,20 +3082,24 @@ var __webpack_exports__ = {};
|
|
|
3053
3082
|
if (!this.isFirstCompile && pendingReloadReason) reloadInstruction = {
|
|
3054
3083
|
type: pendingReloadReason
|
|
3055
3084
|
};
|
|
3056
|
-
else if (!this.isFirstCompile) {
|
|
3057
|
-
const
|
|
3058
|
-
const hasServiceWorkerChange =
|
|
3085
|
+
else if (!this.isFirstCompile && pendingChangedSources.length > 0) {
|
|
3086
|
+
const isServiceWorkerSource = (rel)=>/(^|\/)background(\.|\/)/i.test(rel) || /service[-_.]?worker/i.test(rel);
|
|
3087
|
+
const hasServiceWorkerChange = pendingChangedSources.some(isServiceWorkerSource);
|
|
3059
3088
|
if (hasServiceWorkerChange) reloadInstruction = {
|
|
3060
3089
|
type: 'service-worker',
|
|
3061
|
-
changedAssets
|
|
3090
|
+
changedAssets: pendingChangedSources
|
|
3062
3091
|
};
|
|
3063
|
-
else
|
|
3064
|
-
const
|
|
3065
|
-
if (
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3069
|
-
|
|
3092
|
+
else {
|
|
3093
|
+
const contentScriptCount = readContentScriptCount(compilation, outputPath);
|
|
3094
|
+
if (contentScriptCount > 0) {
|
|
3095
|
+
const entries = [];
|
|
3096
|
+
for(let i = 0; i < contentScriptCount; i++)entries.push((0, contracts.Y0)(i));
|
|
3097
|
+
reloadInstruction = {
|
|
3098
|
+
type: "content-scripts",
|
|
3099
|
+
changedContentScriptEntries: entries,
|
|
3100
|
+
changedAssets: pendingChangedSources
|
|
3101
|
+
};
|
|
3102
|
+
}
|
|
3070
3103
|
}
|
|
3071
3104
|
}
|
|
3072
3105
|
const wasFirstCompile = this.isFirstCompile;
|
|
@@ -3120,50 +3153,30 @@ var __webpack_exports__ = {};
|
|
|
3120
3153
|
}
|
|
3121
3154
|
}
|
|
3122
3155
|
_define_property(BrowsersPlugin, "name", 'plugin-browsers');
|
|
3156
|
+
function readContentScriptCount(compilation, outputPath) {
|
|
3157
|
+
try {
|
|
3158
|
+
const asset = compilation.getAsset?.('manifest.json');
|
|
3159
|
+
if (asset?.source) {
|
|
3160
|
+
const manifest = JSON.parse(String(asset.source.source()));
|
|
3161
|
+
const list = manifest?.content_scripts;
|
|
3162
|
+
if (Array.isArray(list)) return list.length;
|
|
3163
|
+
}
|
|
3164
|
+
} catch {}
|
|
3165
|
+
try {
|
|
3166
|
+
const fs = __webpack_require__("fs");
|
|
3167
|
+
const manifestPath = external_path_.join(outputPath, 'manifest.json');
|
|
3168
|
+
if (fs.existsSync(manifestPath)) {
|
|
3169
|
+
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
|
|
3170
|
+
const list = manifest?.content_scripts;
|
|
3171
|
+
if (Array.isArray(list)) return list.length;
|
|
3172
|
+
}
|
|
3173
|
+
} catch {}
|
|
3174
|
+
return 0;
|
|
3175
|
+
}
|
|
3123
3176
|
var typescript = __webpack_require__("./plugin-js-frameworks/js-tools/typescript.ts");
|
|
3124
3177
|
async function extensionDev(pathOrRemoteUrl, devOptions) {
|
|
3125
3178
|
let browsersPlugin;
|
|
3126
|
-
let emitter;
|
|
3127
|
-
if (devOptions.launcher && !devOptions.noBrowser) {
|
|
3128
|
-
browsersPlugin = new BrowsersPlugin({
|
|
3129
|
-
launcher: devOptions.launcher,
|
|
3130
|
-
browserOptions: {
|
|
3131
|
-
browser: devOptions.browser,
|
|
3132
|
-
mode: 'development',
|
|
3133
|
-
enableDevtools: true,
|
|
3134
|
-
noOpen: devOptions.noOpen,
|
|
3135
|
-
profile: devOptions.profile,
|
|
3136
|
-
persistProfile: devOptions.persistProfile,
|
|
3137
|
-
preferences: devOptions.preferences,
|
|
3138
|
-
browserFlags: devOptions.browserFlags,
|
|
3139
|
-
startingUrl: devOptions.startingUrl,
|
|
3140
|
-
chromiumBinary: devOptions.chromiumBinary,
|
|
3141
|
-
geckoBinary: devOptions.geckoBinary || devOptions.firefoxBinary,
|
|
3142
|
-
port: devOptions.port,
|
|
3143
|
-
source: devOptions.source,
|
|
3144
|
-
watchSource: devOptions.watchSource,
|
|
3145
|
-
sourceFormat: devOptions.sourceFormat,
|
|
3146
|
-
sourceSummary: devOptions.sourceSummary,
|
|
3147
|
-
sourceMeta: devOptions.sourceMeta,
|
|
3148
|
-
sourceProbe: devOptions.sourceProbe,
|
|
3149
|
-
sourceTree: devOptions.sourceTree,
|
|
3150
|
-
sourceConsole: devOptions.sourceConsole,
|
|
3151
|
-
sourceDom: devOptions.sourceDom,
|
|
3152
|
-
sourceMaxBytes: devOptions.sourceMaxBytes,
|
|
3153
|
-
sourceRedact: devOptions.sourceRedact,
|
|
3154
|
-
sourceIncludeShadow: devOptions.sourceIncludeShadow,
|
|
3155
|
-
sourceDiff: devOptions.sourceDiff,
|
|
3156
|
-
logLevel: devOptions.logLevel,
|
|
3157
|
-
logContexts: devOptions.logContexts,
|
|
3158
|
-
logFormat: devOptions.logFormat,
|
|
3159
|
-
logTimestamps: devOptions.logTimestamps,
|
|
3160
|
-
logColor: devOptions.logColor,
|
|
3161
|
-
logUrl: devOptions.logUrl,
|
|
3162
|
-
logTab: devOptions.logTab
|
|
3163
|
-
}
|
|
3164
|
-
});
|
|
3165
|
-
emitter = browsersPlugin.emitter;
|
|
3166
|
-
} else emitter = new BuildEmitter();
|
|
3179
|
+
let emitter = new BuildEmitter();
|
|
3167
3180
|
const projectStructure = await getProjectStructure(pathOrRemoteUrl);
|
|
3168
3181
|
try {
|
|
3169
3182
|
const isAuthor = 'true' === process.env.EXTENSION_AUTHOR_MODE;
|
|
@@ -3179,9 +3192,57 @@ var __webpack_exports__ = {};
|
|
|
3179
3192
|
console.log(messages.SG(manifestDir, packageJsonDir));
|
|
3180
3193
|
console.log(messages._A(browser, devOptions.chromiumBinary, geckoBinary));
|
|
3181
3194
|
}
|
|
3195
|
+
const browserConfig = await (0, config_loader.xY)(packageJsonDir, browser);
|
|
3196
|
+
const commandConfig = await (0, config_loader.eY)(packageJsonDir, 'dev');
|
|
3197
|
+
const merged = {
|
|
3198
|
+
...(0, sanitize.a)(browserConfig),
|
|
3199
|
+
...(0, sanitize.a)(commandConfig),
|
|
3200
|
+
...(0, sanitize.a)(devOptions)
|
|
3201
|
+
};
|
|
3202
|
+
if (devOptions.launcher && !devOptions.noBrowser) {
|
|
3203
|
+
browsersPlugin = new BrowsersPlugin({
|
|
3204
|
+
launcher: devOptions.launcher,
|
|
3205
|
+
browserOptions: {
|
|
3206
|
+
browser,
|
|
3207
|
+
mode: 'development',
|
|
3208
|
+
enableDevtools: true,
|
|
3209
|
+
noOpen: merged.noOpen,
|
|
3210
|
+
profile: merged.profile,
|
|
3211
|
+
persistProfile: merged.persistProfile,
|
|
3212
|
+
preferences: merged.preferences,
|
|
3213
|
+
browserFlags: merged.browserFlags,
|
|
3214
|
+
excludeBrowserFlags: merged.excludeBrowserFlags,
|
|
3215
|
+
startingUrl: merged.startingUrl,
|
|
3216
|
+
chromiumBinary: merged.chromiumBinary,
|
|
3217
|
+
geckoBinary: merged.geckoBinary || merged.firefoxBinary,
|
|
3218
|
+
port: merged.port,
|
|
3219
|
+
source: merged.source,
|
|
3220
|
+
watchSource: merged.watchSource,
|
|
3221
|
+
sourceFormat: merged.sourceFormat,
|
|
3222
|
+
sourceSummary: merged.sourceSummary,
|
|
3223
|
+
sourceMeta: merged.sourceMeta,
|
|
3224
|
+
sourceProbe: merged.sourceProbe,
|
|
3225
|
+
sourceTree: merged.sourceTree,
|
|
3226
|
+
sourceConsole: merged.sourceConsole,
|
|
3227
|
+
sourceDom: merged.sourceDom,
|
|
3228
|
+
sourceMaxBytes: merged.sourceMaxBytes,
|
|
3229
|
+
sourceRedact: merged.sourceRedact,
|
|
3230
|
+
sourceIncludeShadow: merged.sourceIncludeShadow,
|
|
3231
|
+
sourceDiff: merged.sourceDiff,
|
|
3232
|
+
logLevel: merged.logLevel,
|
|
3233
|
+
logContexts: merged.logContexts,
|
|
3234
|
+
logFormat: merged.logFormat,
|
|
3235
|
+
logTimestamps: merged.logTimestamps,
|
|
3236
|
+
logColor: merged.logColor,
|
|
3237
|
+
logUrl: merged.logUrl,
|
|
3238
|
+
logTab: merged.logTab
|
|
3239
|
+
}
|
|
3240
|
+
});
|
|
3241
|
+
emitter = browsersPlugin.emitter;
|
|
3242
|
+
}
|
|
3182
3243
|
if ('true' === process.env.EXTENSION_DEV_DRY_RUN) return emitter;
|
|
3183
3244
|
const { devServer } = await Promise.all([
|
|
3184
|
-
__webpack_require__.e("
|
|
3245
|
+
__webpack_require__.e("740"),
|
|
3185
3246
|
__webpack_require__.e("481")
|
|
3186
3247
|
]).then(__webpack_require__.bind(__webpack_require__, "./dev-server/index.ts"));
|
|
3187
3248
|
await devServer(projectStructure, {
|
|
@@ -3191,14 +3252,13 @@ var __webpack_exports__ = {};
|
|
|
3191
3252
|
geckoBinary,
|
|
3192
3253
|
browsersPlugin
|
|
3193
3254
|
});
|
|
3255
|
+
return emitter;
|
|
3194
3256
|
} catch (error) {
|
|
3195
3257
|
console.error(error);
|
|
3196
3258
|
process.exit(1);
|
|
3197
3259
|
}
|
|
3198
|
-
return emitter;
|
|
3199
3260
|
}
|
|
3200
3261
|
var plugin_playwright = __webpack_require__("./plugin-playwright/index.ts");
|
|
3201
|
-
var sanitize = __webpack_require__("./lib/sanitize.ts");
|
|
3202
3262
|
var utils = __webpack_require__("./plugin-special-folders/folder-extensions/utils.ts");
|
|
3203
3263
|
function resolveCompanionExtensionDirs(opts) {
|
|
3204
3264
|
const { projectRoot, config } = opts;
|
|
@@ -3285,7 +3345,7 @@ var __webpack_exports__ = {};
|
|
|
3285
3345
|
metadata.writeError('preview_manifest_missing', `Expected manifest at ${manifestAtOutput}`);
|
|
3286
3346
|
throw new Error(`Preview is run-only and does not compile.\nExpected an unpacked extension at:\n ${manifestAtOutput}\n\nRun \`extension build\` or \`extension dev\` first, or pass --output-path to an existing unpacked extension directory.`);
|
|
3287
3347
|
}
|
|
3288
|
-
const commandConfig = await (0, config_loader.eY)(packageJsonDir,
|
|
3348
|
+
const commandConfig = await (0, config_loader.eY)(packageJsonDir, metadataCommand);
|
|
3289
3349
|
const browserConfig = await (0, config_loader.xY)(packageJsonDir, browser);
|
|
3290
3350
|
console.log(messages.V_(browser));
|
|
3291
3351
|
if (previewOptions.noBrowser) {
|
package/dist/preview.cjs
CHANGED
|
@@ -150,7 +150,7 @@ var __webpack_modules__ = {
|
|
|
150
150
|
module.exports = require("pintor");
|
|
151
151
|
},
|
|
152
152
|
"./package.json" (module) {
|
|
153
|
-
module.exports = JSON.parse('{"rE":"3.14.
|
|
153
|
+
module.exports = JSON.parse('{"rE":"3.14.2-canary.281.9f4638a","El":{"@prefresh/core":"1.5.9","@prefresh/utils":"1.2.1","@rspack/core":"^1.7.5","@rspack/dev-server":"^1.2.1","@rspack/plugin-preact-refresh":"1.1.4","@rspack/plugin-react-refresh":"1.6.0","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","@vue/compiler-sfc":"3.5.26","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","extension-from-store":"^0.1.1","go-git-it":"^5.1.5","ignore":"^7.0.5","less":"4.5.1","less-loader":"12.3.0","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5-utilities":"^1.0.0","pintor":"0.3.0","postcss":"8.5.6","postcss-loader":"8.2.0","postcss-preset-env":"11.1.1","postcss-scss":"4.0.9","preact":"10.27.3","react-refresh":"0.18.0","sass-loader":"16.0.6","schema-utils":"^4.3.3","svelte-loader":"3.2.4","tiny-glob":"^0.2.9","typescript":"5.9.3","unique-names-generator":"^4.7.1","vue":"3.5.26","vue-loader":"17.4.2","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3"}}');
|
|
154
154
|
}
|
|
155
155
|
};
|
|
156
156
|
var __webpack_module_cache__ = {};
|
|
@@ -1363,7 +1363,7 @@ var __webpack_exports__ = {};
|
|
|
1363
1363
|
metadata.writeError('preview_manifest_missing', `Expected manifest at ${manifestAtOutput}`);
|
|
1364
1364
|
throw new Error(`Preview is run-only and does not compile.\nExpected an unpacked extension at:\n ${manifestAtOutput}\n\nRun \`extension build\` or \`extension dev\` first, or pass --output-path to an existing unpacked extension directory.`);
|
|
1365
1365
|
}
|
|
1366
|
-
const commandConfig = await loadCommandConfig(packageJsonDir,
|
|
1366
|
+
const commandConfig = await loadCommandConfig(packageJsonDir, metadataCommand);
|
|
1367
1367
|
const browserConfig = await loadBrowserConfig(packageJsonDir, browser);
|
|
1368
1368
|
console.log(lib_messages.V_(browser));
|
|
1369
1369
|
if (previewOptions.noBrowser) {
|
package/package.json
CHANGED