@plaudit/webpack-extensions 2.31.2 → 2.32.0

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.
@@ -7,7 +7,7 @@ interface AdvancedOutputConfig {
7
7
  directoryLayout?: 'blocks' | 'extensions';
8
8
  }
9
9
  type IndividualExternalDepConfig = string | {
10
- import: string | [string, ...string[]];
10
+ import?: string | [string, ...string[]];
11
11
  handle: string;
12
12
  };
13
13
  type Externals = {
@@ -236,11 +236,12 @@ function makeDependencyExtractionPlugin(externals) {
236
236
  const exactExternals = {};
237
237
  const suffixExternals = [];
238
238
  for (const [key, value] of Object.entries(externals)) {
239
+ const normalizedValue = typeof value !== 'string' && value.import === undefined ? { ...value, import: key } : value;
239
240
  if (key.startsWith("*/")) {
240
- suffixExternals.push([key.substring(1), typeof value === 'string' ? { import: value, handle: key.substring(2) } : value]);
241
+ suffixExternals.push([key.substring(1), typeof normalizedValue === 'string' ? { import: normalizedValue, handle: key.substring(2) } : normalizedValue]);
241
242
  }
242
243
  else {
243
- exactExternals[key] = value;
244
+ exactExternals[key] = normalizedValue;
244
245
  }
245
246
  }
246
247
  const resolvePossibleExternal = (request) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "2.31.2",
3
+ "version": "2.32.0",
4
4
  "scripts": {
5
5
  "prepublishOnly": "rm -rf build && mkdir build && tsc",
6
6
  "build": "tsc",