@lwrjs/npm-module-provider 0.19.0-alpha.5 → 0.19.0-alpha.6

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.
@@ -86,6 +86,9 @@ async function resolveNpmModuleSpecifierBlock(specifier, dest, config) {
86
86
  } else if (pkg.module) {
87
87
  pkg.main = pkg.module;
88
88
  }
89
+ if (browser && typeof browser === "object" && typeof pkg.main === "string" && browser[pkg.main]) {
90
+ pkg.main = browser[pkg.main];
91
+ }
89
92
  if (pkg.version) {
90
93
  pkgVersion = pkg.version;
91
94
  }
@@ -69,6 +69,22 @@ export async function resolveNpmModuleSpecifierBlock(specifier, dest, config) {
69
69
  else if (pkg.module) {
70
70
  pkg.main = pkg.module;
71
71
  }
72
+ // 4. If we have an alternate browser mapping for this entry point, use it
73
+ // Exmaple:
74
+ // {
75
+ // "main": "./node-cjs.js",
76
+ // "module": "./node-esm.js",
77
+ // "browser": {
78
+ // "./node-cjs.js": "./browser-cjs.js",
79
+ // "./node-esm.js": "./browser-esm.js"
80
+ // }
81
+ // }
82
+ if (browser &&
83
+ typeof browser === 'object' &&
84
+ typeof pkg.main === 'string' &&
85
+ browser[pkg.main]) {
86
+ pkg.main = browser[pkg.main];
87
+ }
72
88
  // Grab package.json version (if set) before we go.
73
89
  if (pkg.version) {
74
90
  pkgVersion = pkg.version;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.19.0-alpha.5",
7
+ "version": "0.19.0-alpha.6",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -36,13 +36,13 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@esbuild-plugins/node-modules-polyfill": "^0.2.2",
39
- "@lwrjs/diagnostics": "0.19.0-alpha.5",
40
- "@lwrjs/shared-utils": "0.19.0-alpha.5",
41
- "esbuild": "^0.9.7",
39
+ "@lwrjs/diagnostics": "0.19.0-alpha.6",
40
+ "@lwrjs/shared-utils": "0.19.0-alpha.6",
41
+ "esbuild": "^0.25.2",
42
42
  "resolve": "^1.22.8"
43
43
  },
44
44
  "devDependencies": {
45
- "@lwrjs/types": "0.19.0-alpha.5",
45
+ "@lwrjs/types": "0.19.0-alpha.6",
46
46
  "jest": "29.7.0",
47
47
  "memfs": "^4.13.0",
48
48
  "ts-jest": "^29.2.6"
@@ -53,5 +53,5 @@
53
53
  "volta": {
54
54
  "extends": "../../../package.json"
55
55
  },
56
- "gitHead": "6728aa9a43de91722a8f4da47d364b2a25895a7b"
56
+ "gitHead": "25933a335c7f2f6ebc39381feda5f47e07e43faa"
57
57
  }