ptech-preset 1.3.6 → 1.3.8
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/index.js +4 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -407,14 +407,6 @@ function pluginCore(opts) {
|
|
|
407
407
|
const command = api?.context?.command;
|
|
408
408
|
const isBuild = command === "build";
|
|
409
409
|
const isDev = !isBuild;
|
|
410
|
-
if (isDev && mfMerged.shared && typeof mfMerged.shared === "object") {
|
|
411
|
-
for (const key of Object.keys(mfMerged.shared)) {
|
|
412
|
-
const conf = mfMerged.shared[key];
|
|
413
|
-
if (!conf || typeof conf !== "object") continue;
|
|
414
|
-
if (/^react(-dom)?$/.test(key)) continue;
|
|
415
|
-
if ("eager" in conf) conf.eager = false;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
410
|
if (cssInjection !== "none") {
|
|
419
411
|
const cssAbs = path3.resolve(root, cssEntry);
|
|
420
412
|
const hasCss = fs3.existsSync(cssAbs);
|
|
@@ -443,9 +435,8 @@ function pluginCore(opts) {
|
|
|
443
435
|
const target = JSON.stringify(targetImport);
|
|
444
436
|
lines.push(`export * from ${target};`);
|
|
445
437
|
lines.push(`export { default } from ${target};`);
|
|
446
|
-
lines.push(
|
|
447
|
-
|
|
448
|
-
);
|
|
438
|
+
lines.push(`;(import.meta as any).webpackHot?.accept?.();`);
|
|
439
|
+
lines.push(`;(import.meta as any).hot?.accept?.();`);
|
|
449
440
|
lines.push(`// generated by plugin-mf-auto`);
|
|
450
441
|
fs3.writeFileSync(proxyFile, lines.join(os.EOL), "utf8");
|
|
451
442
|
const relFromRoot = path3.relative(root, proxyFile).replace(/\\/g, "/");
|
|
@@ -460,7 +451,8 @@ function pluginCore(opts) {
|
|
|
460
451
|
fs3.writeFileSync(
|
|
461
452
|
stylesFile,
|
|
462
453
|
`import ${JSON.stringify(cssImport)};
|
|
463
|
-
|
|
454
|
+
;(import.meta as any).webpackHot?.accept?.();
|
|
455
|
+
;(import.meta as any).hot?.accept?.();
|
|
464
456
|
// generated by plugin-mf-auto`,
|
|
465
457
|
"utf8"
|
|
466
458
|
);
|