ptech-preset 1.4.3 → 1.4.9
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.d.ts +1 -0
- package/dist/index.js +10 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -146,7 +146,7 @@ var DEFAULT_SHARED = {
|
|
|
146
146
|
requiredVersion: false
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
|
-
var CDN_BASE = "https://oneportal.
|
|
149
|
+
var CDN_BASE = "https://oneportal-ehckg7axe3dacxhw.a01.azurefd.net/external/ts/";
|
|
150
150
|
function getPackageName(root) {
|
|
151
151
|
try {
|
|
152
152
|
const pkgPath = path3.resolve(root, "package.json");
|
|
@@ -354,6 +354,7 @@ function pluginCore(opts) {
|
|
|
354
354
|
separateExposeChunkPrefix = "mf-expose-",
|
|
355
355
|
typesFolder = "@mf-types",
|
|
356
356
|
devTypesRefreshEnvVar = "MF_DTS_REFRESH",
|
|
357
|
+
isHost,
|
|
357
358
|
mf
|
|
358
359
|
} = opts;
|
|
359
360
|
if (!mf || typeof mf !== "object") {
|
|
@@ -404,9 +405,9 @@ function pluginCore(opts) {
|
|
|
404
405
|
if (typeof mfMerged.shared === "undefined") {
|
|
405
406
|
mfMerged.shared = DEFAULT_SHARED;
|
|
406
407
|
}
|
|
407
|
-
const
|
|
408
|
-
console.log("command:",
|
|
409
|
-
const isBuild =
|
|
408
|
+
const action = api.context.action;
|
|
409
|
+
console.log("command:", action);
|
|
410
|
+
const isBuild = action === "build";
|
|
410
411
|
const isDev = !isBuild;
|
|
411
412
|
if (cssInjection !== "none") {
|
|
412
413
|
const cssAbs = path3.resolve(root, cssEntry);
|
|
@@ -522,12 +523,12 @@ function pluginCore(opts) {
|
|
|
522
523
|
config.output ??= {};
|
|
523
524
|
const fallbackCdn = `${CDN_BASE}${pkgSafe}/`;
|
|
524
525
|
if (isBuild) {
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
526
|
+
if (isHost) {
|
|
527
|
+
config.output.assetPrefix = "/";
|
|
528
|
+
} else {
|
|
529
|
+
config.output.assetPrefix = fallbackCdn;
|
|
530
|
+
}
|
|
528
531
|
} else {
|
|
529
|
-
console.log("DEV");
|
|
530
|
-
console.log("config.output.assetPrefix", config.output.assetPrefix);
|
|
531
532
|
config.output.assetPrefix = "/";
|
|
532
533
|
}
|
|
533
534
|
return config;
|