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 CHANGED
@@ -18,6 +18,7 @@ type MfAutoOptions = {
18
18
  /** env để ép refresh types ở dev (khởi động lại dev) */
19
19
  devTypesRefreshEnvVar?: string;
20
20
  mf: Record<string, any>;
21
+ isHost?: boolean;
21
22
  };
22
23
  declare function pluginCore(opts: MfAutoOptions): RsbuildPlugin;
23
24
 
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.blob.core.windows.net/external/ts/";
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 command = api?.context?.command;
408
- console.log("command:", command);
409
- const isBuild = command === "build";
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
- config.output.assetPrefix = fallbackCdn;
526
- console.log("BUILD");
527
- console.log("config.output.assetPrefix", config.output.assetPrefix);
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ptech-preset",
3
- "version": "1.4.3",
3
+ "version": "1.4.9",
4
4
  "description": "Auto Module.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",