@lwrjs/module-bundler 0.13.0-alpha.4 → 0.13.0-alpha.5

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.
@@ -116,7 +116,12 @@ async function getBundleCode(rootModule, moduleGraphs, includedModules, bundleGr
116
116
  }
117
117
  linkedDefinition.linkedModuleRecord.dynamicImports?.forEach((dynamicImport) => {
118
118
  if (dynamicImport.moduleNameType !== "unresolved") {
119
- dynamicImports.set(`${dynamicImport.specifier}_${dynamicImport.version}`, dynamicImport);
119
+ const moduleId = (0, import_shared_utils.explodeSpecifier)(dynamicImport.specifier);
120
+ const importReference = {
121
+ ...dynamicImport,
122
+ specifier: moduleId.specifier
123
+ };
124
+ dynamicImports.set((0, import_shared_utils.getSpecifier)(importReference), importReference);
120
125
  }
121
126
  });
122
127
  if (specifier.includes("#")) {
@@ -167,7 +172,8 @@ async function amdBundler(rootModuleId, moduleRegistry, minify = false, runtimeE
167
172
  };
168
173
  return (0, import_shared_utils.getModuleGraphs)(graphSpecifier, graphOptions, moduleRegistry, moduleRegistry, runtimeEnvironment, runtimeParams);
169
174
  };
170
- const moduleGraphs = await getModuleGraphsWrapper(rootModuleId.specifier);
175
+ const versionedSpecifier = (0, import_shared_utils.getSpecifier)(rootModuleId);
176
+ const moduleGraphs = await getModuleGraphsWrapper(versionedSpecifier);
171
177
  const rootModule = moduleGraphs.graphs[0];
172
178
  const groupModuleGraphsMap = new Map();
173
179
  if (!cachedGroupieCode && groupies && groupies.length) {
@@ -109,7 +109,13 @@ async function getBundleCode(rootModule, moduleGraphs, includedModules, bundleGr
109
109
  // add any dynamic imports from each of the linked definitions in the module graph
110
110
  linkedDefinition.linkedModuleRecord.dynamicImports?.forEach((dynamicImport) => {
111
111
  if (dynamicImport.moduleNameType !== 'unresolved') {
112
- dynamicImports.set(`${dynamicImport.specifier}_${dynamicImport.version}`, dynamicImport);
112
+ // Linked specifiers add a version to them We do not want this in the bundle record specifier
113
+ const moduleId = explodeSpecifier(dynamicImport.specifier);
114
+ const importReference = {
115
+ ...dynamicImport,
116
+ specifier: moduleId.specifier,
117
+ };
118
+ dynamicImports.set(getSpecifier(importReference), importReference);
113
119
  }
114
120
  });
115
121
  // skip relative dependencies
@@ -175,7 +181,8 @@ export async function amdBundler(rootModuleId, moduleRegistry, minify = false, r
175
181
  };
176
182
  return getModuleGraphs(graphSpecifier, graphOptions, moduleRegistry, moduleRegistry, runtimeEnvironment, runtimeParams);
177
183
  };
178
- const moduleGraphs = await getModuleGraphsWrapper(rootModuleId.specifier);
184
+ const versionedSpecifier = getSpecifier(rootModuleId);
185
+ const moduleGraphs = await getModuleGraphsWrapper(versionedSpecifier);
179
186
  const rootModule = moduleGraphs.graphs[0];
180
187
  // we also need to get moduleGraphs for any group members this module belongs to
181
188
  const groupModuleGraphsMap = new Map();
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.13.0-alpha.4",
7
+ "version": "0.13.0-alpha.5",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -47,14 +47,14 @@
47
47
  "build/**/*.d.ts"
48
48
  ],
49
49
  "dependencies": {
50
- "@lwrjs/diagnostics": "0.13.0-alpha.4",
51
- "@lwrjs/instrumentation": "0.13.0-alpha.4",
52
- "@lwrjs/shared-utils": "0.13.0-alpha.4",
50
+ "@lwrjs/diagnostics": "0.13.0-alpha.5",
51
+ "@lwrjs/instrumentation": "0.13.0-alpha.5",
52
+ "@lwrjs/shared-utils": "0.13.0-alpha.5",
53
53
  "@rollup/plugin-replace": "^2.4.2",
54
54
  "rollup": "^2.78.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@lwrjs/types": "0.13.0-alpha.4",
57
+ "@lwrjs/types": "0.13.0-alpha.5",
58
58
  "jest": "^26.6.3",
59
59
  "ts-jest": "^26.5.6"
60
60
  },
@@ -70,5 +70,5 @@
70
70
  "volta": {
71
71
  "extends": "../../../package.json"
72
72
  },
73
- "gitHead": "1a3c46bb34ab4f3501c118943b4297a95b6e4978"
73
+ "gitHead": "228fe607cb3f377a11efe53dd800c4f53a4eab66"
74
74
  }