extension-develop 3.7.0 → 3.8.1

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/module.cjs CHANGED
@@ -127339,8 +127339,7 @@ var __webpack_modules__ = {
127339
127339
  });
127340
127340
  var path__rspack_import_0 = __webpack_require__("path");
127341
127341
  var path__rspack_import_0_default = /*#__PURE__*/ __webpack_require__.n(path__rspack_import_0);
127342
- var fs__rspack_import_1 = __webpack_require__("fs");
127343
- var browser_extension_manifest_fields__rspack_import_2 = __webpack_require__("browser-extension-manifest-fields");
127342
+ var browser_extension_manifest_fields__rspack_import_1 = __webpack_require__("browser-extension-manifest-fields");
127344
127343
  function isUnderPublicDir(entry, projectRoot, publicDir) {
127345
127344
  if (!entry) return false;
127346
127345
  const normalizedEntry = String(entry);
@@ -127366,14 +127365,14 @@ var __webpack_modules__ = {
127366
127365
  function getSpecialFoldersDataForCompiler(compiler) {
127367
127366
  const projectRoot = compiler.options.context || '';
127368
127367
  const publicDir = path__rspack_import_0_default().join(projectRoot, 'public');
127369
- const data = (0, browser_extension_manifest_fields__rspack_import_2.getSpecialFoldersData)({
127368
+ const data = (0, browser_extension_manifest_fields__rspack_import_1.getSpecialFoldersData)({
127370
127369
  manifestPath: path__rspack_import_0_default().join(projectRoot, 'package.json')
127371
127370
  });
127372
127371
  return finalizeSpecialFoldersData(data, projectRoot, publicDir);
127373
127372
  }
127374
127373
  function getSpecialFoldersDataForProjectRoot(projectRoot) {
127375
127374
  const publicDir = path__rspack_import_0_default().join(projectRoot, 'public');
127376
- const data = (0, browser_extension_manifest_fields__rspack_import_2.getSpecialFoldersData)({
127375
+ const data = (0, browser_extension_manifest_fields__rspack_import_1.getSpecialFoldersData)({
127377
127376
  manifestPath: path__rspack_import_0_default().join(projectRoot, 'package.json')
127378
127377
  });
127379
127378
  return finalizeSpecialFoldersData(data, projectRoot, publicDir);
@@ -127383,40 +127382,22 @@ var __webpack_modules__ = {
127383
127382
  ...data,
127384
127383
  pages: filterPublicEntrypoints(data.pages, projectRoot, publicDir),
127385
127384
  scripts: filterPublicEntrypoints(data.scripts, projectRoot, publicDir),
127386
- extensions: getLocalExtensionsConfig(projectRoot)
127385
+ extensions: void 0
127387
127386
  };
127388
127387
  }
127389
- function getLocalExtensionsConfig(projectRoot) {
127390
- if (!projectRoot) return;
127391
- const extensionsDir = path__rspack_import_0_default().join(projectRoot, 'extensions');
127392
- try {
127393
- if (fs__rspack_import_1.existsSync(extensionsDir) && fs__rspack_import_1.statSync(extensionsDir).isDirectory()) return {
127394
- dir: './extensions'
127395
- };
127396
- } catch {}
127397
- }
127398
127388
  },
127399
127389
  "./webpack/plugin-browsers/browsers-lib/banner.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
127400
127390
  "use strict";
127401
127391
  __webpack_require__.d(__webpack_exports__, {
127402
- a: ()=>printDevBannerOnce,
127403
- M: ()=>printProdBannerOnce
127392
+ M: ()=>printProdBannerOnce,
127393
+ a: ()=>printDevBannerOnce
127404
127394
  });
127405
- var external_fs_ = __webpack_require__("fs");
127406
- var external_path_ = __webpack_require__("path");
127407
- var messages = __webpack_require__("./webpack/plugin-browsers/browsers-lib/messages.ts");
127408
- var webpack_lib_messages = __webpack_require__("./webpack/webpack-lib/messages.ts");
127409
- const sharedState = {
127410
- bannerPrinted: false,
127411
- pendingCompilationLine: ''
127412
- };
127413
- function markBannerPrinted() {
127414
- sharedState.bannerPrinted = true;
127415
- if (sharedState.pendingCompilationLine) {
127416
- console.log(sharedState.pendingCompilationLine);
127417
- sharedState.pendingCompilationLine = '';
127418
- }
127419
- }
127395
+ var fs__rspack_import_0 = __webpack_require__("fs");
127396
+ var path__rspack_import_1 = __webpack_require__("path");
127397
+ var crypto__rspack_import_2 = __webpack_require__("crypto");
127398
+ var _messages__rspack_import_3 = __webpack_require__("./webpack/plugin-browsers/browsers-lib/messages.ts");
127399
+ var _webpack_lib_messages__rspack_import_4 = __webpack_require__("./webpack/webpack-lib/messages.ts");
127400
+ var _plugin_compilation_compilation_lib_shared_state__rspack_import_5 = __webpack_require__("./webpack/plugin-compilation/compilation-lib/shared-state.ts");
127420
127401
  const printedKeys = new Set();
127421
127402
  function readUpdateSuffixOnce() {
127422
127403
  const suffix = process.env.EXTENSION_CLI_UPDATE_SUFFIX;
@@ -127427,17 +127408,67 @@ var __webpack_modules__ = {
127427
127408
  function keyFor(browser, outPath, hp) {
127428
127409
  const host = (hp?.host || '127.0.0.1').toString();
127429
127410
  const port = hp?.port == null ? '' : String(hp.port);
127430
- return `${browser}::${external_path_.resolve(outPath)}::${host}:${port}`;
127411
+ return `${browser}::${path__rspack_import_1.resolve(outPath)}::${host}:${port}`;
127412
+ }
127413
+ function toNormalizedId(value) {
127414
+ if ('string' != typeof value) return '';
127415
+ return value.trim();
127416
+ }
127417
+ function deriveChromiumExtensionIdFromManifest(manifest) {
127418
+ const key = toNormalizedId(manifest?.key);
127419
+ if (!key) return '';
127420
+ try {
127421
+ const decodedKey = Buffer.from(key.replace(/\s+/g, ''), 'base64');
127422
+ if (!decodedKey.length) return '';
127423
+ const digest = (0, crypto__rspack_import_2.createHash)('sha256').update(decodedKey).digest().subarray(0, 16);
127424
+ let extensionId = '';
127425
+ for (const byte of digest){
127426
+ extensionId += String.fromCharCode(97 + (byte >> 4 & 0x0f));
127427
+ extensionId += String.fromCharCode(97 + (0x0f & byte));
127428
+ }
127429
+ return extensionId;
127430
+ } catch {
127431
+ return '';
127432
+ }
127433
+ }
127434
+ function deriveFirefoxExtensionIdFromManifest(manifest) {
127435
+ const fromBrowserSpecificSettings = toNormalizedId(manifest?.browser_specific_settings?.gecko?.id);
127436
+ if (fromBrowserSpecificSettings) return fromBrowserSpecificSettings;
127437
+ return toNormalizedId(manifest?.applications?.gecko?.id);
127438
+ }
127439
+ function resolveExtensionId(args) {
127440
+ const fromInfo = toNormalizedId(args.info?.extensionId);
127441
+ if (fromInfo) return fromInfo;
127442
+ const fromFallback = toNormalizedId(args.fallback?.extensionId);
127443
+ if (fromFallback) return fromFallback;
127444
+ if ('chrome' === args.browser || 'edge' === args.browser || 'chromium' === args.browser || 'chromium-based' === args.browser) return deriveChromiumExtensionIdFromManifest(args.manifest);
127445
+ if ('firefox' === args.browser || 'firefox-based' === args.browser) return deriveFirefoxExtensionIdFromManifest(args.manifest);
127446
+ return '';
127431
127447
  }
127432
127448
  async function printDevBannerOnce(opts) {
127433
127449
  const k = keyFor(opts.browser, opts.outPath, opts.hostPort);
127434
127450
  if (printedKeys.has(k)) return false;
127435
- const info = await opts.getInfo() || null;
127436
- const manifestPath = external_path_.join(opts.outPath, 'manifest.json');
127451
+ const manifestPath = path__rspack_import_1.join(opts.outPath, 'manifest.json');
127437
127452
  const updateSuffix = readUpdateSuffixOnce();
127438
- if (!external_fs_.existsSync(manifestPath)) return false;
127439
- const manifest = JSON.parse(external_fs_.readFileSync(manifestPath, 'utf-8'));
127440
- const extensionId = info?.extensionId || opts.fallback?.extensionId || '(temporary)';
127453
+ if (!fs__rspack_import_0.existsSync(manifestPath)) return false;
127454
+ const manifest = JSON.parse(fs__rspack_import_0.readFileSync(manifestPath, 'utf-8'));
127455
+ const manifestDerivedExtensionId = resolveExtensionId({
127456
+ browser: opts.browser,
127457
+ info: null,
127458
+ fallback: opts.fallback,
127459
+ manifest
127460
+ });
127461
+ const info = manifestDerivedExtensionId ? await Promise.race([
127462
+ opts.getInfo().catch(()=>null),
127463
+ new Promise((resolve)=>setTimeout(()=>resolve(null), 250))
127464
+ ]) : await opts.getInfo().catch(()=>null);
127465
+ const extensionId = resolveExtensionId({
127466
+ browser: opts.browser,
127467
+ info,
127468
+ fallback: opts.fallback,
127469
+ manifest
127470
+ });
127471
+ if (!extensionId) return false;
127441
127472
  const name = info?.name || opts.fallback?.name || manifest.name;
127442
127473
  const version1 = info?.version || opts.fallback?.version || manifest.version;
127443
127474
  const message = {
@@ -127449,10 +127480,10 @@ var __webpack_modules__ = {
127449
127480
  }
127450
127481
  }
127451
127482
  };
127452
- console.log(messages.io8());
127453
- console.log(messages.e_P(manifest, opts.browser, message, opts.browserVersionLine, updateSuffix || void 0));
127454
- console.log(messages.io8());
127455
- markBannerPrinted();
127483
+ console.log(_messages__rspack_import_3.io8());
127484
+ console.log(_messages__rspack_import_3.e_P(manifest, opts.browser, message, opts.browserVersionLine, updateSuffix || void 0));
127485
+ console.log(_messages__rspack_import_3.io8());
127486
+ (0, _plugin_compilation_compilation_lib_shared_state__rspack_import_5.If)();
127456
127487
  process.env.EXTENSION_CLI_BANNER_PRINTED = 'true';
127457
127488
  printedKeys.add(k);
127458
127489
  return true;
@@ -127463,23 +127494,33 @@ var __webpack_modules__ = {
127463
127494
  const browserLabel = opts.browserVersionLine && opts.browserVersionLine.trim().length > 0 ? opts.browserVersionLine.trim() : String(opts.browser || 'unknown');
127464
127495
  const updateSuffix = readUpdateSuffixOnce();
127465
127496
  try {
127466
- const manifestPath = external_path_.join(opts.outPath, 'manifest.json');
127467
- const manifest = JSON.parse(external_fs_.readFileSync(manifestPath, 'utf-8'));
127468
- if (opts.runtime && opts.runtime.extensionId) {
127497
+ const manifestPath = path__rspack_import_1.join(opts.outPath, 'manifest.json');
127498
+ const manifest = JSON.parse(fs__rspack_import_0.readFileSync(manifestPath, 'utf-8'));
127499
+ const runtimeInfo = opts.runtime ? {
127500
+ extensionId: opts.runtime.extensionId,
127501
+ name: opts.runtime.name,
127502
+ version: opts.runtime.version
127503
+ } : null;
127504
+ const resolvedExtensionId = resolveExtensionId({
127505
+ browser: opts.browser,
127506
+ info: runtimeInfo,
127507
+ manifest
127508
+ });
127509
+ if (resolvedExtensionId) {
127469
127510
  const message = {
127470
127511
  data: {
127471
- id: opts.runtime.extensionId,
127512
+ id: resolvedExtensionId,
127472
127513
  management: {
127473
- name: opts.runtime.name || manifest.name,
127474
- version: opts.runtime.version || manifest.version
127514
+ name: opts.runtime?.name || manifest.name,
127515
+ version: opts.runtime?.version || manifest.version
127475
127516
  }
127476
127517
  }
127477
127518
  };
127478
- console.log(messages.io8());
127479
- console.log(messages.e_P(manifest, opts.browser, message, browserLabel, updateSuffix || void 0, {
127519
+ console.log(_messages__rspack_import_3.io8());
127520
+ console.log(_messages__rspack_import_3.e_P(manifest, opts.browser, message, browserLabel, updateSuffix || void 0, {
127480
127521
  includeExtensionId: opts.includeExtensionId
127481
127522
  }));
127482
- console.log(messages.io8());
127523
+ console.log(_messages__rspack_import_3.io8());
127483
127524
  } else {
127484
127525
  const message = {
127485
127526
  data: {
@@ -127490,18 +127531,18 @@ var __webpack_modules__ = {
127490
127531
  }
127491
127532
  }
127492
127533
  };
127493
- console.log(messages.io8());
127494
- console.log(messages.e_P(manifest, opts.browser, message, browserLabel, updateSuffix || void 0, {
127534
+ console.log(_messages__rspack_import_3.io8());
127535
+ console.log(_messages__rspack_import_3.e_P(manifest, opts.browser, message, browserLabel, updateSuffix || void 0, {
127495
127536
  includeExtensionId: opts.includeExtensionId
127496
127537
  }));
127497
- console.log(messages.io8());
127538
+ console.log(_messages__rspack_import_3.io8());
127498
127539
  }
127499
127540
  } catch {
127500
- console.log(messages.io8());
127501
- console.log(webpack_lib_messages.Al(opts.outPath, browserLabel));
127502
- console.log(messages.io8());
127541
+ console.log(_messages__rspack_import_3.io8());
127542
+ console.log(_webpack_lib_messages__rspack_import_4.Al(opts.outPath, browserLabel));
127543
+ console.log(_messages__rspack_import_3.io8());
127503
127544
  }
127504
- markBannerPrinted();
127545
+ (0, _plugin_compilation_compilation_lib_shared_state__rspack_import_5.If)();
127505
127546
  process.env.EXTENSION_CLI_BANNER_PRINTED = 'true';
127506
127547
  printedKeys.add(k);
127507
127548
  return true;
@@ -127886,24 +127927,11 @@ var __webpack_modules__ = {
127886
127927
  else if ('chrome' === browser || 'chromium' === browser || 'firefox' === browser || 'edge' === browser) browserNorm = browser;
127887
127928
  const finalCachePath = browserNorm && cacheDir ? path__rspack_import_0.join(cacheDir, browserNorm) : cacheDir;
127888
127929
  try {
127889
- if (finalCachePath && finalCachePath.trim().length > 0) {
127890
- const lines = cleaned.split(/\r?\n/);
127891
- const idx = lines.findIndex((l)=>/npx\s+@puppeteer\/browsers\s+install\s+/i.test(l));
127892
- if (-1 !== idx && !/--path\s+/i.test(lines[idx])) {
127893
- lines[idx] = `${lines[idx].trim()} --path "${finalCachePath}"`;
127894
- cleaned = lines.join('\n');
127895
- }
127896
- try {
127897
- const pwIdx = lines.findIndex((l)=>/npx\s+playwright\s+install(\s+.+)?/i.test(l));
127898
- if (-1 !== pwIdx) {
127899
- if (finalCachePath && finalCachePath.trim().length > 0) {
127900
- const cmd = lines[pwIdx].trim();
127901
- const withEnv = 'win32' === process.platform ? `set PLAYWRIGHT_BROWSERS_PATH="${finalCachePath}" && ${cmd}` : `PLAYWRIGHT_BROWSERS_PATH="${finalCachePath}" ${cmd}`;
127902
- lines[pwIdx] = withEnv;
127903
- cleaned = lines.join('\n');
127904
- }
127905
- }
127906
- } catch {}
127930
+ const lines = cleaned.split(/\r?\n/);
127931
+ const idx = lines.findIndex((l)=>/npx\s+@puppeteer\/browsers\s+install\s+|npx\s+playwright\s+install(\s+.+)?/i.test(l));
127932
+ if (-1 !== idx) {
127933
+ lines[idx] = `npx extension install ${browserNorm}`;
127934
+ cleaned = lines.join('\n');
127907
127935
  }
127908
127936
  } catch {}
127909
127937
  body.push(cleaned);
@@ -128218,7 +128246,7 @@ var __webpack_modules__ = {
128218
128246
  const displayName = String(manifestName);
128219
128247
  const displayVersion = String(version1 || manifest.version || '');
128220
128248
  lines.push(` 🧩 ${pintor__rspack_import_4_default().brightBlue('Extension.js')} ${pintor__rspack_import_4_default().gray(`${extensionVersion}`)}${updateNotice}`, ` Browser ${pintor__rspack_import_4_default().gray(browserLabel)}`, ` Extension ${pintor__rspack_import_4_default().gray(displayVersion ? `${displayName} ${displayVersion}` : displayName)}`);
128221
- if (includeExtensionId) lines.push(` Extension ID ${pintor__rspack_import_4_default().gray(cleanId)}`);
128249
+ if (includeExtensionId && cleanId) lines.push(` Extension ID ${pintor__rspack_import_4_default().gray(cleanId)}`);
128222
128250
  return lines.join('\n');
128223
128251
  }
128224
128252
  function emptyLine() {
@@ -128956,9 +128984,6 @@ var __webpack_modules__ = {
128956
128984
  ...isWin ? {
128957
128985
  windowsHide: true
128958
128986
  } : {},
128959
- ...isWin && /\s/.test(bin) ? {
128960
- shell: true
128961
- } : {},
128962
128987
  ...'win32' !== process.platform && {
128963
128988
  group: process.getgid?.()
128964
128989
  }
@@ -129103,7 +129128,7 @@ var __webpack_modules__ = {
129103
129128
  try {
129104
129129
  return (0, external_chrome_location2_.getInstallGuidance)();
129105
129130
  } catch {
129106
- return 'npx @puppeteer/browsers install chrome@stable';
129131
+ return 'npx extension install chrome';
129107
129132
  }
129108
129133
  };
129109
129134
  switch(browser){
@@ -129186,7 +129211,7 @@ var __webpack_modules__ = {
129186
129211
  try {
129187
129212
  return (0, external_edge_location_.getInstallGuidance)();
129188
129213
  } catch {
129189
- return 'npx playwright install msedge';
129214
+ return 'npx extension install edge';
129190
129215
  }
129191
129216
  })();
129192
129217
  this.printEnhancedPuppeteerInstallHint(compilation, guidance, 'edge');
@@ -129201,7 +129226,7 @@ var __webpack_modules__ = {
129201
129226
  try {
129202
129227
  return (0, external_edge_location_.getInstallGuidance)();
129203
129228
  } catch {
129204
- return 'npx playwright install msedge';
129229
+ return 'npx extension install edge';
129205
129230
  }
129206
129231
  })();
129207
129232
  const fallback = resolveWslWindowsBinary(browser);
@@ -129287,7 +129312,7 @@ var __webpack_modules__ = {
129287
129312
  try {
129288
129313
  return (0, external_chromium_location_.getInstallGuidance)();
129289
129314
  } catch {
129290
- return 'npx @puppeteer/browsers install chromium';
129315
+ return 'npx extension install chromium';
129291
129316
  }
129292
129317
  })();
129293
129318
  this.printEnhancedPuppeteerInstallHint(compilation, chromiumGuidance, 'chromium');
@@ -130147,6 +130172,9 @@ var __webpack_modules__ = {
130147
130172
  const args = [
130148
130173
  '--no-remote',
130149
130174
  '--new-instance',
130175
+ ...'win32' === process.platform ? [
130176
+ '-wait-for-browser'
130177
+ ] : [],
130150
130178
  '-profile',
130151
130179
  profilePath,
130152
130180
  ...debugPort > 0 ? [
@@ -130357,7 +130385,7 @@ var __webpack_modules__ = {
130357
130385
  try {
130358
130386
  return (0, external_firefox_location2_.getInstallGuidance)();
130359
130387
  } catch {
130360
- return 'npx @puppeteer/browsers install firefox';
130388
+ return 'npx extension install firefox';
130361
130389
  }
130362
130390
  })();
130363
130391
  this.printInstallHint(compilation, guidance);
@@ -130454,6 +130482,9 @@ var __webpack_modules__ = {
130454
130482
  '-start-debugger-server',
130455
130483
  String(debugPort)
130456
130484
  ] : [],
130485
+ ...'win32' === process.platform ? [
130486
+ '-wait-for-browser'
130487
+ ] : [],
130457
130488
  '--foreground',
130458
130489
  '--disable-background-timer-throttling',
130459
130490
  '--disable-backgrounding-occluded-windows',
@@ -130499,9 +130530,7 @@ var __webpack_modules__ = {
130499
130530
  this.watchTimeout = void 0;
130500
130531
  }
130501
130532
  if ('true' === process.env.EXTENSION_AUTHOR_MODE) this.ctx.logger?.info?.(messages.Tho(this.host.browser));
130502
- this.cleanupInstance().finally(()=>{
130503
- process.exit();
130504
- });
130533
+ this.cleanupInstance().catch(()=>{});
130505
130534
  });
130506
130535
  if ('true' === process.env.EXTENSION_AUTHOR_MODE && child) {
130507
130536
  child.stdout?.pipe(process.stdout);
@@ -130615,7 +130644,7 @@ var __webpack_modules__ = {
130615
130644
  host: '127.0.0.1'
130616
130645
  },
130617
130646
  getInfo: async ()=>({
130618
- extensionId: extensionId || '(temporary)',
130647
+ extensionId,
130619
130648
  name: manifest.name,
130620
130649
  version: manifest.version
130621
130650
  }),
@@ -131382,6 +131411,31 @@ var __webpack_modules__ = {
131382
131411
  }
131383
131412
  }
131384
131413
  },
131414
+ "./webpack/plugin-compilation/compilation-lib/shared-state.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
131415
+ "use strict";
131416
+ __webpack_require__.d(__webpack_exports__, {
131417
+ FF: ()=>setPendingCompilationLine,
131418
+ If: ()=>markBannerPrinted,
131419
+ TC: ()=>isBannerPrinted
131420
+ });
131421
+ const sharedState = {
131422
+ bannerPrinted: false,
131423
+ pendingCompilationLine: ''
131424
+ };
131425
+ function markBannerPrinted() {
131426
+ sharedState.bannerPrinted = true;
131427
+ if (sharedState.pendingCompilationLine) {
131428
+ console.log(sharedState.pendingCompilationLine);
131429
+ sharedState.pendingCompilationLine = '';
131430
+ }
131431
+ }
131432
+ function isBannerPrinted() {
131433
+ return sharedState.bannerPrinted;
131434
+ }
131435
+ function setPendingCompilationLine(line) {
131436
+ sharedState.pendingCompilationLine = line;
131437
+ }
131438
+ },
131385
131439
  "./webpack/plugin-css/css-lib/integrations.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
131386
131440
  "use strict";
131387
131441
  __webpack_require__.d(__webpack_exports__, {
@@ -131875,20 +131929,35 @@ var __webpack_modules__ = {
131875
131929
  }
131876
131930
  return false;
131877
131931
  }
131932
+ function resolveLessLoader(projectPath) {
131933
+ const extensionRoot = (0, _css_lib_integrations__rspack_import_3.He)();
131934
+ const paths = [
131935
+ projectPath,
131936
+ extensionRoot || void 0,
131937
+ process.cwd()
131938
+ ].filter(Boolean);
131939
+ try {
131940
+ return require.resolve('less-loader', {
131941
+ paths
131942
+ });
131943
+ } catch {
131944
+ return;
131945
+ }
131946
+ }
131878
131947
  async function maybeUseLess(projectPath, manifestPath) {
131879
131948
  const resolvedManifestPath = manifestPath || path__rspack_import_0.join(projectPath, 'manifest.json');
131880
131949
  if (!isUsingLess(projectPath)) return [];
131881
- try {
131882
- require.resolve('less-loader');
131883
- } catch (e) {
131950
+ let lessLoaderPath = resolveLessLoader(projectPath);
131951
+ if (!lessLoaderPath) {
131884
131952
  const lessDependencies = [
131885
131953
  'less',
131886
131954
  'less-loader'
131887
131955
  ];
131888
131956
  const didInstall = await (0, _css_lib_integrations__rspack_import_3.tm)('LESS', lessDependencies);
131889
131957
  if (!didInstall) throw new Error('[LESS] Optional dependencies failed to install.');
131890
- console.log(_css_lib_messages__rspack_import_2.Jv('LESS'));
131891
- process.exit(0);
131958
+ lessLoaderPath = resolveLessLoader(projectPath);
131959
+ if (!lessLoaderPath) throw new Error('[LESS] less-loader could not be resolved after optional dependency installation.');
131960
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_css_lib_messages__rspack_import_2.Jv('LESS'));
131892
131961
  }
131893
131962
  return [
131894
131963
  {
@@ -131896,7 +131965,7 @@ var __webpack_modules__ = {
131896
131965
  exclude: /\.module\.less$/,
131897
131966
  use: [
131898
131967
  {
131899
- loader: require.resolve('less-loader'),
131968
+ loader: lessLoaderPath,
131900
131969
  options: {
131901
131970
  sourceMap: true
131902
131971
  }
@@ -131907,7 +131976,7 @@ var __webpack_modules__ = {
131907
131976
  test: /\.module\.less$/,
131908
131977
  use: [
131909
131978
  {
131910
- loader: require.resolve('less-loader'),
131979
+ loader: lessLoaderPath,
131911
131980
  options: {
131912
131981
  sourceMap: true
131913
131982
  }
@@ -132112,6 +132181,24 @@ var __webpack_modules__ = {
132112
132181
  return false;
132113
132182
  }
132114
132183
  async function maybeUsePostCss(projectPath, opts) {
132184
+ const getResolutionPaths = ()=>{
132185
+ const extensionRoot = (0, _css_lib_integrations__rspack_import_5.He)();
132186
+ const paths = [
132187
+ projectPath,
132188
+ extensionRoot || void 0,
132189
+ process.cwd()
132190
+ ].filter(Boolean);
132191
+ return Array.from(new Set(paths));
132192
+ };
132193
+ const resolvePostCssLoader = ()=>{
132194
+ try {
132195
+ return require.resolve('postcss-loader', {
132196
+ paths: getResolutionPaths()
132197
+ });
132198
+ } catch {
132199
+ return;
132200
+ }
132201
+ };
132115
132202
  const userPostCssConfig = findPostCssConfig(projectPath);
132116
132203
  const userConfigMentionsTailwind = userConfigMentionsTailwindPlugin(userPostCssConfig);
132117
132204
  const userConfigUsesDirectTailwindReference = userConfigUsesDirectTailwindPluginReference(userPostCssConfig);
@@ -132134,9 +132221,8 @@ var __webpack_modules__ = {
132134
132221
  const tailwindPresent = (0, _tailwind__rspack_import_6.F)(projectPath);
132135
132222
  const tailwindConfigured = tailwindPresent || userConfigMentionsTailwind;
132136
132223
  if (!userPostCssConfig && !pkgHasPostCss && !tailwindPresent) return {};
132137
- try {
132138
- require.resolve('postcss-loader');
132139
- } catch (_error) {
132224
+ let resolvedPostCssLoader = resolvePostCssLoader();
132225
+ if (!resolvedPostCssLoader) {
132140
132226
  if (!(0, _sass__rspack_import_7.fZ)(projectPath) && !(0, _less__rspack_import_8.K)(projectPath)) {
132141
132227
  const postCssDependencies = [
132142
132228
  'postcss',
@@ -132145,8 +132231,9 @@ var __webpack_modules__ = {
132145
132231
  const didInstall = await (0, _css_lib_integrations__rspack_import_5.tm)('PostCSS', postCssDependencies);
132146
132232
  if (!didInstall) throw new Error('[PostCSS] Optional dependencies failed to install.');
132147
132233
  }
132148
- console.log(_css_lib_messages__rspack_import_4.Jv('PostCSS'));
132149
- process.exit(0);
132234
+ resolvedPostCssLoader = resolvePostCssLoader();
132235
+ if (!resolvedPostCssLoader) throw new Error('[PostCSS] postcss-loader could not be resolved after optional dependency installation.');
132236
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_css_lib_messages__rspack_import_4.Jv('PostCSS'));
132150
132237
  }
132151
132238
  let pluginsFromOptions;
132152
132239
  const shouldInjectTailwindPlugin = tailwindConfigured && !pkgHasPostCss && (!userPostCssConfig || userConfigIsCjsInEsm || userConfigMentionsTailwind);
@@ -132255,7 +132342,7 @@ var __webpack_modules__ = {
132255
132342
  return {
132256
132343
  test: /\.css$/,
132257
132344
  type: 'css',
132258
- loader: require.resolve('postcss-loader'),
132345
+ loader: resolvedPostCssLoader,
132259
132346
  options: {
132260
132347
  postcssOptions,
132261
132348
  sourceMap: 'development' === opts.mode
@@ -132287,6 +132374,21 @@ var __webpack_modules__ = {
132287
132374
  }
132288
132375
  return false;
132289
132376
  }
132377
+ function resolveSassLoader(projectPath) {
132378
+ const extensionRoot = (0, _css_lib_integrations__rspack_import_4.He)();
132379
+ const paths = [
132380
+ projectPath,
132381
+ extensionRoot || void 0,
132382
+ process.cwd()
132383
+ ].filter(Boolean);
132384
+ try {
132385
+ return require.resolve('sass-loader', {
132386
+ paths
132387
+ });
132388
+ } catch {
132389
+ return;
132390
+ }
132391
+ }
132290
132392
  function resolveSassImplementation(projectPath) {
132291
132393
  const bases = [
132292
132394
  projectPath,
@@ -132321,9 +132423,8 @@ var __webpack_modules__ = {
132321
132423
  }
132322
132424
  async function maybeUseSass(projectPath) {
132323
132425
  if (!isUsingSass(projectPath)) return [];
132324
- try {
132325
- require.resolve('sass-loader');
132326
- } catch (e) {
132426
+ let sassLoaderPath = resolveSassLoader(projectPath);
132427
+ if (!sassLoaderPath) {
132327
132428
  const postCssDependencies = [
132328
132429
  'postcss-loader',
132329
132430
  'postcss-scss',
@@ -132336,8 +132437,9 @@ var __webpack_modules__ = {
132336
132437
  ];
132337
132438
  const didInstallSass = await (0, _css_lib_integrations__rspack_import_4.tm)('SASS', sassDependencies);
132338
132439
  if (!didInstallSass) throw new Error('[SASS] Optional dependencies failed to install.');
132339
- console.log(_css_lib_messages__rspack_import_3.Jv('SASS'));
132340
- process.exit(0);
132440
+ sassLoaderPath = resolveSassLoader(projectPath);
132441
+ if (!sassLoaderPath) throw new Error('[SASS] sass-loader could not be resolved after optional dependency installation.');
132442
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_css_lib_messages__rspack_import_3.Jv('SASS'));
132341
132443
  }
132342
132444
  return [
132343
132445
  {
@@ -132345,7 +132447,7 @@ var __webpack_modules__ = {
132345
132447
  exclude: /\.module\.(sass|scss)$/,
132346
132448
  use: [
132347
132449
  {
132348
- loader: require.resolve('sass-loader'),
132450
+ loader: sassLoaderPath,
132349
132451
  options: createSassLoaderOptions(projectPath, 'development')
132350
132452
  }
132351
132453
  ]
@@ -132354,7 +132456,7 @@ var __webpack_modules__ = {
132354
132456
  test: /\.module\.(sass|scss)$/,
132355
132457
  use: [
132356
132458
  {
132357
- loader: require.resolve('sass-loader'),
132459
+ loader: sassLoaderPath,
132358
132460
  options: createSassLoaderOptions(projectPath, 'development')
132359
132461
  }
132360
132462
  ]
@@ -132398,6 +132500,7 @@ var __webpack_modules__ = {
132398
132500
  "use strict";
132399
132501
  __webpack_require__.d(__webpack_exports__, {
132400
132502
  Dy: ()=>_plugin_css_css_lib_integrations__rspack_import_0.Dy,
132503
+ He: ()=>_plugin_css_css_lib_integrations__rspack_import_0.He,
132401
132504
  qQ: ()=>isUsingJSFramework,
132402
132505
  tm: ()=>_plugin_css_css_lib_integrations__rspack_import_0.tm,
132403
132506
  ws: ()=>_plugin_css_css_lib_integrations__rspack_import_0.ws
@@ -132515,14 +132618,33 @@ var __webpack_modules__ = {
132515
132618
  var _js_frameworks_lib_messages__rspack_import_3 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/messages.ts");
132516
132619
  var _frameworks_lib_integrations__rspack_import_4 = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
132517
132620
  let userMessageDelivered = false;
132518
- let cachedPreactRefreshPlugin;
132519
- function getPreactRefreshPlugin() {
132520
- if (cachedPreactRefreshPlugin) return cachedPreactRefreshPlugin;
132621
+ function resolveWithRuntimePaths(id, projectPath) {
132622
+ const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_4.He)();
132623
+ const paths = [
132624
+ projectPath,
132625
+ extensionRoot || void 0,
132626
+ process.cwd()
132627
+ ].filter(Boolean);
132521
132628
  try {
132522
- const mod = __webpack_require__("@rspack/plugin-preact-refresh");
132629
+ return require.resolve(id, {
132630
+ paths
132631
+ });
132632
+ } catch {
132633
+ return;
132634
+ }
132635
+ }
132636
+ function getPreactRefreshPlugin(projectPath) {
132637
+ const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_4.He)();
132638
+ const bases = [
132639
+ projectPath,
132640
+ extensionRoot || void 0,
132641
+ process.cwd()
132642
+ ].filter(Boolean);
132643
+ for (const base of bases)try {
132644
+ const req = (0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(base, 'package.json'));
132645
+ const mod = req('@rspack/plugin-preact-refresh');
132523
132646
  const plugin = mod && mod.default || mod;
132524
- cachedPreactRefreshPlugin = plugin;
132525
- return cachedPreactRefreshPlugin;
132647
+ if (plugin) return plugin;
132526
132648
  } catch {}
132527
132649
  }
132528
132650
  function isUsingPreact(projectPath) {
@@ -132537,9 +132659,8 @@ var __webpack_modules__ = {
132537
132659
  }
132538
132660
  async function maybeUsePreact(projectPath) {
132539
132661
  if (!isUsingPreact(projectPath)) return;
132540
- try {
132541
- require.resolve('@rspack/plugin-preact-refresh');
132542
- } catch (e) {
132662
+ let preactRefreshPath = resolveWithRuntimePaths('@rspack/plugin-preact-refresh', projectPath);
132663
+ if (!preactRefreshPath) {
132543
132664
  const preactDependencies = [
132544
132665
  '@prefresh/core',
132545
132666
  '@prefresh/utils',
@@ -132548,10 +132669,11 @@ var __webpack_modules__ = {
132548
132669
  ];
132549
132670
  const didInstall = await (0, _frameworks_lib_integrations__rspack_import_4.tm)('Preact', preactDependencies);
132550
132671
  if (!didInstall) throw new Error('[Preact] Optional dependencies failed to install.');
132551
- console.log(_js_frameworks_lib_messages__rspack_import_3.Jv('Preact'));
132552
- process.exit(0);
132672
+ preactRefreshPath = resolveWithRuntimePaths('@rspack/plugin-preact-refresh', projectPath);
132673
+ if (!preactRefreshPath) throw new Error('[Preact] @rspack/plugin-preact-refresh could not be resolved after optional dependency installation.');
132674
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_js_frameworks_lib_messages__rspack_import_3.Jv('Preact'));
132553
132675
  }
132554
- const PreactRefreshPlugin = getPreactRefreshPlugin();
132676
+ const PreactRefreshPlugin = getPreactRefreshPlugin(projectPath);
132555
132677
  if (!PreactRefreshPlugin) throw new Error('[Preact] @rspack/plugin-preact-refresh is installed but its plugin could not be resolved.');
132556
132678
  const preactPlugins = [
132557
132679
  new PreactRefreshPlugin({})
@@ -132596,14 +132718,33 @@ var __webpack_modules__ = {
132596
132718
  var _js_frameworks_lib_messages__rspack_import_3 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/messages.ts");
132597
132719
  var _frameworks_lib_integrations__rspack_import_4 = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
132598
132720
  let userMessageDelivered = false;
132599
- let cachedReactRefreshPlugin;
132600
- function getReactRefreshPlugin() {
132601
- if (cachedReactRefreshPlugin) return cachedReactRefreshPlugin;
132721
+ function resolveWithRuntimePaths(id, projectPath) {
132722
+ const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_4.He)();
132723
+ const paths = [
132724
+ projectPath,
132725
+ extensionRoot || void 0,
132726
+ process.cwd()
132727
+ ].filter(Boolean);
132602
132728
  try {
132603
- const mod = __webpack_require__("@rspack/plugin-react-refresh");
132729
+ return require.resolve(id, {
132730
+ paths
132731
+ });
132732
+ } catch {
132733
+ return;
132734
+ }
132735
+ }
132736
+ function getReactRefreshPlugin(projectPath) {
132737
+ const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_4.He)();
132738
+ const bases = [
132739
+ projectPath,
132740
+ extensionRoot || void 0,
132741
+ process.cwd()
132742
+ ].filter(Boolean);
132743
+ for (const base of bases)try {
132744
+ const req = (0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(base, 'package.json'));
132745
+ const mod = req('@rspack/plugin-react-refresh');
132604
132746
  const plugin = mod && mod.default || mod;
132605
- cachedReactRefreshPlugin = plugin;
132606
- return cachedReactRefreshPlugin;
132747
+ if (plugin) return plugin;
132607
132748
  } catch {}
132608
132749
  }
132609
132750
  function isUsingReact(projectPath) {
@@ -132618,19 +132759,19 @@ var __webpack_modules__ = {
132618
132759
  }
132619
132760
  async function maybeUseReact(projectPath) {
132620
132761
  if (!isUsingReact(projectPath)) return;
132621
- try {
132622
- require.resolve('react-refresh');
132623
- } catch (e) {
132762
+ let reactRefreshPath = resolveWithRuntimePaths('react-refresh', projectPath);
132763
+ if (!reactRefreshPath) {
132624
132764
  const reactDependencies = [
132625
132765
  'react-refresh',
132626
132766
  '@rspack/plugin-react-refresh'
132627
132767
  ];
132628
132768
  const didInstall = await (0, _frameworks_lib_integrations__rspack_import_4.tm)('React', reactDependencies);
132629
132769
  if (!didInstall) throw new Error('[React] Optional dependencies failed to install.');
132630
- console.log(_js_frameworks_lib_messages__rspack_import_3.Jv('React'));
132631
- process.exit(0);
132770
+ reactRefreshPath = resolveWithRuntimePaths('react-refresh', projectPath);
132771
+ if (!reactRefreshPath) throw new Error('[React] react-refresh could not be resolved after optional dependency installation.');
132772
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_js_frameworks_lib_messages__rspack_import_3.Jv('React'));
132632
132773
  }
132633
- const ReactRefreshPlugin = getReactRefreshPlugin();
132774
+ const ReactRefreshPlugin = getReactRefreshPlugin(projectPath);
132634
132775
  if (!ReactRefreshPlugin) throw new Error('[React] @rspack/plugin-react-refresh is installed but its plugin could not be resolved.');
132635
132776
  const reactPlugins = [
132636
132777
  new ReactRefreshPlugin({
@@ -132683,6 +132824,21 @@ var __webpack_modules__ = {
132683
132824
  var _frameworks_lib_integrations__rspack_import_3 = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
132684
132825
  var _js_frameworks_lib_load_loader_options__rspack_import_4 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/load-loader-options.ts");
132685
132826
  let userMessageDelivered = false;
132827
+ function resolveWithRuntimePaths(id, projectPath) {
132828
+ const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_3.He)();
132829
+ const paths = [
132830
+ projectPath,
132831
+ extensionRoot || void 0,
132832
+ process.cwd()
132833
+ ].filter(Boolean);
132834
+ try {
132835
+ return require.resolve(id, {
132836
+ paths
132837
+ });
132838
+ } catch {
132839
+ return;
132840
+ }
132841
+ }
132686
132842
  function resolveFromProject(id, projectPath) {
132687
132843
  try {
132688
132844
  return require.resolve(id, {
@@ -132705,9 +132861,8 @@ var __webpack_modules__ = {
132705
132861
  }
132706
132862
  async function maybeUseSvelte(projectPath, mode) {
132707
132863
  if (!isUsingSvelte(projectPath)) return;
132708
- try {
132709
- resolveFromProject('svelte-loader', projectPath) || require.resolve('svelte-loader');
132710
- } catch (e) {
132864
+ let svelteLoaderPath = resolveFromProject('svelte-loader', projectPath) || resolveWithRuntimePaths('svelte-loader', projectPath);
132865
+ if (!svelteLoaderPath) {
132711
132866
  const typeScriptDependencies = [
132712
132867
  "typescript"
132713
132868
  ];
@@ -132718,27 +132873,22 @@ var __webpack_modules__ = {
132718
132873
  ];
132719
132874
  const didInstallSvelte = await (0, _frameworks_lib_integrations__rspack_import_3.tm)('Svelte', svelteDependencies);
132720
132875
  if (!didInstallSvelte) throw new Error('[Svelte] Optional dependencies failed to install.');
132721
- console.log(_js_frameworks_lib_messages__rspack_import_2.Jv('Svelte'));
132722
- process.exit(0);
132876
+ svelteLoaderPath = resolveFromProject('svelte-loader', projectPath) || resolveWithRuntimePaths('svelte-loader', projectPath);
132877
+ if (!svelteLoaderPath) throw new Error('[Svelte] svelte-loader could not be resolved after optional dependency installation.');
132878
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_js_frameworks_lib_messages__rspack_import_2.Jv('Svelte'));
132723
132879
  }
132724
- try {
132725
- require.resolve("typescript", {
132726
- paths: [
132727
- projectPath,
132728
- process.cwd()
132729
- ]
132730
- });
132731
- } catch (e) {
132880
+ const resolvedTypescript = resolveFromProject("typescript", projectPath) || resolveWithRuntimePaths("typescript", projectPath);
132881
+ if (!resolvedTypescript) {
132732
132882
  const typeScriptDependencies = [
132733
132883
  "typescript"
132734
132884
  ];
132735
132885
  const didInstallTs = await (0, _frameworks_lib_integrations__rspack_import_3.tm)('TypeScript', typeScriptDependencies);
132736
132886
  if (!didInstallTs) throw new Error('[TypeScript] Optional dependencies failed to install.');
132737
- console.log(_js_frameworks_lib_messages__rspack_import_2.Jv('TypeScript'));
132738
- process.exit(0);
132887
+ const reResolvedTypescript = resolveFromProject("typescript", projectPath) || resolveWithRuntimePaths("typescript", projectPath);
132888
+ if (!reResolvedTypescript) throw new Error('[TypeScript] TypeScript could not be resolved after optional dependency installation.');
132889
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_js_frameworks_lib_messages__rspack_import_2.Jv('TypeScript'));
132739
132890
  }
132740
132891
  const customOptions = await (0, _js_frameworks_lib_load_loader_options__rspack_import_4.g)(projectPath, 'svelte');
132741
- const svelteLoaderPath = resolveFromProject('svelte-loader', projectPath) || require.resolve('svelte-loader');
132742
132892
  const defaultLoaders = [
132743
132893
  {
132744
132894
  test: /\.svelte\.ts$/,
@@ -132953,16 +133103,33 @@ var __webpack_modules__ = {
132953
133103
  var _frameworks_lib_integrations__rspack_import_5 = __webpack_require__("./webpack/plugin-js-frameworks/frameworks-lib/integrations.ts");
132954
133104
  var _js_frameworks_lib_load_loader_options__rspack_import_6 = __webpack_require__("./webpack/plugin-js-frameworks/js-frameworks-lib/load-loader-options.ts");
132955
133105
  let userMessageDelivered = false;
132956
- let cachedVueLoaderPlugin;
132957
- function getVueLoaderPlugin() {
132958
- if (cachedVueLoaderPlugin) return cachedVueLoaderPlugin;
133106
+ function resolveWithRuntimePaths(id, projectPath) {
133107
+ const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_5.He)();
133108
+ const paths = [
133109
+ projectPath,
133110
+ extensionRoot || void 0,
133111
+ process.cwd()
133112
+ ].filter(Boolean);
132959
133113
  try {
132960
- const mod = __webpack_require__("vue-loader");
133114
+ return require.resolve(id, {
133115
+ paths
133116
+ });
133117
+ } catch {
133118
+ return;
133119
+ }
133120
+ }
133121
+ function getVueLoaderPlugin(projectPath) {
133122
+ const extensionRoot = (0, _frameworks_lib_integrations__rspack_import_5.He)();
133123
+ const bases = [
133124
+ projectPath,
133125
+ extensionRoot || void 0,
133126
+ process.cwd()
133127
+ ].filter(Boolean);
133128
+ for (const base of bases)try {
133129
+ const req = (0, module__rspack_import_1.createRequire)(path__rspack_import_0.join(base, 'package.json'));
133130
+ const mod = req('vue-loader');
132961
133131
  const plugin = mod && mod.VueLoaderPlugin || mod && mod.default && mod.default.VueLoaderPlugin;
132962
- if (plugin) {
132963
- cachedVueLoaderPlugin = plugin;
132964
- return cachedVueLoaderPlugin;
132965
- }
133132
+ if (plugin) return plugin;
132966
133133
  } catch {}
132967
133134
  }
132968
133135
  function isUsingVue(projectPath) {
@@ -132975,25 +133142,25 @@ var __webpack_modules__ = {
132975
133142
  }
132976
133143
  async function maybeUseVue(projectPath, mode = 'development') {
132977
133144
  if (!isUsingVue(projectPath)) return;
132978
- try {
132979
- require.resolve('vue-loader');
132980
- } catch (e) {
133145
+ let vueLoaderPath = resolveWithRuntimePaths('vue-loader', projectPath);
133146
+ if (!vueLoaderPath) {
132981
133147
  const vueDependencies = [
132982
133148
  'vue-loader',
132983
133149
  '@vue/compiler-sfc'
132984
133150
  ];
132985
133151
  const didInstall = await (0, _frameworks_lib_integrations__rspack_import_5.tm)('Vue', vueDependencies);
132986
133152
  if (!didInstall) throw new Error('[Vue] Optional dependencies failed to install.');
132987
- console.log(_js_frameworks_lib_messages__rspack_import_4.Jv('Vue'));
132988
- process.exit(0);
133153
+ vueLoaderPath = resolveWithRuntimePaths('vue-loader', projectPath);
133154
+ if (!vueLoaderPath) throw new Error('[Vue] vue-loader could not be resolved after optional dependency installation.');
133155
+ if ('true' === process.env.EXTENSION_AUTHOR_MODE) console.log(_js_frameworks_lib_messages__rspack_import_4.Jv('Vue'));
132989
133156
  }
132990
- const VueLoaderPlugin = getVueLoaderPlugin();
133157
+ const VueLoaderPlugin = getVueLoaderPlugin(projectPath);
132991
133158
  if (!VueLoaderPlugin) throw new Error('[Vue] vue-loader is installed but VueLoaderPlugin could not be resolved.');
132992
133159
  const customOptions = await (0, _js_frameworks_lib_load_loader_options__rspack_import_6.g)(projectPath, 'vue');
132993
133160
  const defaultLoaders = [
132994
133161
  {
132995
133162
  test: /\.vue$/,
132996
- loader: require.resolve('vue-loader'),
133163
+ loader: vueLoaderPath,
132997
133164
  options: {
132998
133165
  experimentalInlineMatchResource: true,
132999
133166
  ...customOptions || {}
@@ -134172,11 +134339,15 @@ var __webpack_modules__ = {
134172
134339
  const invocation = buildSpawnInvocation(command, args);
134173
134340
  const env = buildExecEnv();
134174
134341
  const stdio = options?.stdio ?? 'ignore';
134342
+ const useShell = 'win32' === process.platform && /\.(cmd|bat)$/i.test(invocation.command);
134175
134343
  return new Promise((resolve, reject)=>{
134176
134344
  const child = (0, child_process__rspack_import_2.spawn)(invocation.command, invocation.args, {
134177
134345
  cwd: options?.cwd,
134178
134346
  stdio,
134179
- env: env || process.env
134347
+ env: env || process.env,
134348
+ ...useShell ? {
134349
+ shell: true
134350
+ } : {}
134180
134351
  });
134181
134352
  child.on('close', (code)=>{
134182
134353
  if (0 !== code) reject(new Error(`Install failed with exit code ${code}`));
@@ -134231,7 +134402,8 @@ var __webpack_modules__ = {
134231
134402
  if (fs__rspack_import_0.existsSync(path__rspack_import_1.join(nm, '.pnpm'))) return false;
134232
134403
  if (fs__rspack_import_0.existsSync(path__rspack_import_1.join(nm, '.modules.yaml'))) return false;
134233
134404
  if (hasMarker) try {
134234
- if (fs__rspack_import_0.readdirSync(nm).length > 0) return false;
134405
+ const entries = fs__rspack_import_0.readdirSync(nm).filter((name)=>'.bin' !== name && !name.startsWith('.cache'));
134406
+ if (entries.length > 0) return false;
134235
134407
  } catch {}
134236
134408
  const hasInstalledDep = [
134237
134409
  ...deps,
@@ -134375,14 +134547,6 @@ var __webpack_modules__ = {
134375
134547
  "use strict";
134376
134548
  module.exports = require("@rspack/dev-server");
134377
134549
  },
134378
- "@rspack/plugin-preact-refresh" (module) {
134379
- "use strict";
134380
- module.exports = require("@rspack/plugin-preact-refresh");
134381
- },
134382
- "@rspack/plugin-react-refresh" (module) {
134383
- "use strict";
134384
- module.exports = require("@rspack/plugin-react-refresh");
134385
- },
134386
134550
  "adm-zip" (module) {
134387
134551
  "use strict";
134388
134552
  module.exports = require("adm-zip");
@@ -134487,10 +134651,6 @@ var __webpack_modules__ = {
134487
134651
  "use strict";
134488
134652
  module.exports = require("util");
134489
134653
  },
134490
- "vue-loader" (module) {
134491
- "use strict";
134492
- module.exports = require("vue-loader");
134493
- },
134494
134654
  "webpack-merge" (module) {
134495
134655
  "use strict";
134496
134656
  module.exports = require("webpack-merge");
@@ -134501,7 +134661,7 @@ var __webpack_modules__ = {
134501
134661
  },
134502
134662
  "./package.json" (module) {
134503
134663
  "use strict";
134504
- module.exports = JSON.parse('{"rE":"3.7.0","El":{"@rspack/core":"^1.7.5","@rspack/dev-server":"^1.1.5","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chrome-location2":"4.0.0","chromium-location":"2.0.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","edge-location":"2.2.0","extension-from-store":"^0.1.1","firefox-location2":"3.0.0","go-git-it":"^5.1.1","ignore":"^7.0.5","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5":"^8.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.3.3","tiny-glob":"^0.2.9","unique-names-generator":"^4.7.1","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.19.0"}}');
134664
+ module.exports = JSON.parse('{"rE":"3.8.1","El":{"@rspack/core":"^1.7.5","@rspack/dev-server":"^1.1.5","@swc/core":"^1.15.8","@swc/helpers":"^0.5.18","adm-zip":"^0.5.16","browser-extension-manifest-fields":"^2.2.1","case-sensitive-paths-webpack-plugin":"^2.4.0","chrome-location2":"4.0.0","chromium-location":"2.0.0","content-security-policy-parser":"^0.6.0","cross-spawn":"^7.0.6","dotenv":"^17.2.3","edge-location":"2.2.0","extension-from-store":"^0.1.1","firefox-location2":"3.0.0","go-git-it":"^5.1.1","ignore":"^7.0.5","loader-utils":"^3.3.1","magic-string":"^0.30.21","parse5":"^8.0.0","parse5-utilities":"^1.0.0","pintor":"0.3.0","schema-utils":"^4.3.3","tiny-glob":"^0.2.9","unique-names-generator":"^4.7.1","webextension-polyfill":"^0.12.0","webpack-merge":"^6.0.1","webpack-target-webextension":"^2.1.3","ws":"^8.19.0"}}');
134505
134665
  }
134506
134666
  };
134507
134667
  var __webpack_module_cache__ = {};
@@ -134700,6 +134860,8 @@ var __webpack_exports__ = {};
134700
134860
  if (isUrl(pathOrRemoteUrl)) {
134701
134861
  const url = new URL(pathOrRemoteUrl);
134702
134862
  if (url.protocol.startsWith('http')) {
134863
+ const pathname = url.pathname.toLowerCase();
134864
+ if (pathname.endsWith('.zip')) return await importUrlSourceFromZip(pathOrRemoteUrl);
134703
134865
  if ('https://github.com' !== url.origin) {
134704
134866
  const urlSource = await importUrlSourceFromZip(pathOrRemoteUrl);
134705
134867
  return urlSource;
@@ -134866,6 +135028,77 @@ var __webpack_exports__ = {};
134866
135028
  'install'
134867
135029
  ];
134868
135030
  }
135031
+ function findNearestWorkspaceRoot(startDir) {
135032
+ let current = external_path_.resolve(startDir);
135033
+ while(true){
135034
+ const workspaceFile = external_path_.join(current, 'pnpm-workspace.yaml');
135035
+ if (external_fs_.existsSync(workspaceFile)) return current;
135036
+ const parent = external_path_.dirname(current);
135037
+ if (parent === current) return;
135038
+ current = parent;
135039
+ }
135040
+ }
135041
+ function toRelativePath(baseDir, targetDir) {
135042
+ return external_path_.relative(baseDir, targetDir).split(external_path_.sep).join('/');
135043
+ }
135044
+ function parseWorkspacePatterns(workspaceFilePath) {
135045
+ try {
135046
+ const raw = external_fs_.readFileSync(workspaceFilePath, 'utf8');
135047
+ const lines = raw.split(/\r?\n/);
135048
+ const patterns = [];
135049
+ let inPackages = false;
135050
+ for (const line of lines){
135051
+ const trimmed = line.trim();
135052
+ if (!inPackages) {
135053
+ if ('packages:' === trimmed) inPackages = true;
135054
+ continue;
135055
+ }
135056
+ if (0 === trimmed.length || trimmed.startsWith('#')) continue;
135057
+ if (!trimmed.startsWith('-')) break;
135058
+ const value = trimmed.slice(1).trim();
135059
+ const unquoted = value.replace(/^['"]|['"]$/g, '');
135060
+ if (unquoted.length > 0) patterns.push(unquoted);
135061
+ }
135062
+ return patterns;
135063
+ } catch {
135064
+ return [];
135065
+ }
135066
+ }
135067
+ function globToRegExp(glob) {
135068
+ const normalized = glob.replace(/^\.\//, '').replace(/^!/, '').replace(/\/+$/, '');
135069
+ let pattern = '';
135070
+ for(let i = 0; i < normalized.length; i++){
135071
+ const char = normalized[i];
135072
+ if ('*' === char) {
135073
+ if ('*' === normalized[i + 1]) {
135074
+ pattern += '.*';
135075
+ i += 1;
135076
+ } else pattern += '[^/]*';
135077
+ continue;
135078
+ }
135079
+ if (/[|\\{}()[\]^$+?.]/.test(char)) pattern += `\\${char}`;
135080
+ else pattern += char;
135081
+ }
135082
+ return new RegExp(`^${pattern}$`);
135083
+ }
135084
+ function isProjectIncludedByWorkspace(workspaceRoot, projectPath) {
135085
+ const workspaceFile = external_path_.join(workspaceRoot, 'pnpm-workspace.yaml');
135086
+ const patterns = parseWorkspacePatterns(workspaceFile);
135087
+ if (0 === patterns.length) return true;
135088
+ const relativeProjectPath = toRelativePath(workspaceRoot, projectPath);
135089
+ let included = false;
135090
+ for (const pattern of patterns){
135091
+ const isNegated = pattern.startsWith('!');
135092
+ const matcher = globToRegExp(pattern);
135093
+ if (matcher.test(relativeProjectPath)) included = !isNegated;
135094
+ }
135095
+ return included;
135096
+ }
135097
+ function shouldUsePnpmIsolatedInstall(projectPath) {
135098
+ const workspaceRoot = findNearestWorkspaceRoot(projectPath);
135099
+ if (!workspaceRoot) return false;
135100
+ return !isProjectIncludedByWorkspace(workspaceRoot, projectPath);
135101
+ }
134869
135102
  async function hasDependenciesToInstall(projectPath) {
134870
135103
  try {
134871
135104
  const raw = await external_fs_.promises.readFile(external_path_.join(projectPath, 'package.json'), 'utf8');
@@ -134893,6 +135126,11 @@ var __webpack_exports__ = {};
134893
135126
  ...dependenciesArgs,
134894
135127
  '--include=dev'
134895
135128
  ];
135129
+ if ('pnpm' === pm.name && shouldUsePnpmIsolatedInstall(projectPath)) dependenciesArgs = [
135130
+ ...dependenciesArgs,
135131
+ '--ignore-workspace',
135132
+ '--lockfile=false'
135133
+ ];
134896
135134
  await external_fs_.promises.mkdir(nodeModulesPath, {
134897
135135
  recursive: true
134898
135136
  });
@@ -135297,8 +135535,9 @@ var __webpack_exports__ = {};
135297
135535
  console.error(err.stack || err);
135298
135536
  return reject(err);
135299
135537
  }
135538
+ if (!stats || 'function' != typeof stats.hasErrors) return reject(new Error('Build failed: bundler returned invalid stats output (no reliable compilation result).'));
135300
135539
  if (!buildOptions?.silent && stats) console.log(messages.I(manifestDir, stats, browser));
135301
- if (stats?.hasErrors()) {
135540
+ if (stats.hasErrors()) {
135302
135541
  handleStatsErrors(stats);
135303
135542
  if (!shouldExitOnError) return reject(new Error('Build failed with errors'));
135304
135543
  process.exit(1);