@plaudit/webpack-extensions 2.92.0 → 2.92.1

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/CHANGELOG.md CHANGED
@@ -60,6 +60,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
60
60
  - Legacy PostCSS features that have been integrated into modern CSS
61
61
  - `@extends` support
62
62
 
63
+ ## [2.92.1] - 2026-05-21
64
+ ### Fixed
65
+ - Compatibility issues with module-mode building
66
+ - `module_dependencies` being set to `null` instead of being omitted
67
+
63
68
  ## [2.92.0] - 2026-05-20
64
69
  ### Added
65
70
  - Support for marking `block.json` attributes with `"supports-bindings": true` to enable block binding support in the editor
@@ -283,7 +283,8 @@ class EnhancedBlockJSONPlugin extends AbstractBiPhasicGroupAndEntryPlugin_1.Abst
283
283
  const { dependencies = [], module_dependencies = undefined } = originalValue !== undefined ? assetData : {};
284
284
  let scriptArgsObject;
285
285
  if (rawScriptArgsObject !== undefined) {
286
- scriptArgsObject = { ...rawScriptArgsObject, module_dependencies: (0, shared_1.mergeModuleDependencyArrays)(rawScriptArgsObject.module_dependencies, module_dependencies) };
286
+ const merged_module_dependencies = (0, shared_1.mergeModuleDependencyArrays)(rawScriptArgsObject.module_dependencies, module_dependencies);
287
+ scriptArgsObject = merged_module_dependencies?.length ? { ...rawScriptArgsObject, module_dependencies: merged_module_dependencies } : { ...rawScriptArgsObject };
287
288
  }
288
289
  else {
289
290
  if (inlinedAsset !== undefined) {
@@ -101,7 +101,7 @@ class ExtensionsConfigFileGeneratorPlugin extends AbstractBiPhasicGroupAndEntryP
101
101
  src: isCss ? assetPath.replace(/\.js$/, ".css") : assetPath,
102
102
  rest: isCss || key.startsWith("editor")
103
103
  ? (module_dependencies?.length ? [dependencies, assetData.version, { in_footer: true, module_dependencies }] : [dependencies, assetData.version])
104
- : [dependencies, assetData.version, { strategy: 'defer', module_dependencies: module_dependencies?.length ? module_dependencies : undefined }]
104
+ : [dependencies, assetData.version, module_dependencies?.length ? { strategy: 'defer', module_dependencies } : { strategy: 'defer' }]
105
105
  };
106
106
  (blockExtensionsConfig.blocks[blockSlug] ?? (blockExtensionsConfig.blocks[blockSlug] = {}))[key] = handle;
107
107
  }
@@ -139,7 +139,7 @@ function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
139
139
  const blockJsonChunkName = (0, node_path_1.join)(dest.destination, (0, node_path_1.relative)(srcRoot, dir), "block");
140
140
  const filesRegisteredByJson = [];
141
141
  const presentEntrypoints = (await Promise.all(entrypointFields
142
- .filter(entrypointField => entrypointField in blockJson)
142
+ .filter(entrypointField => (0, shared_1.isScriptModuleField)(entrypointField) === processingModules && entrypointField in blockJson)
143
143
  .flatMap(entrypointField => {
144
144
  return (Array.isArray(blockJson[entrypointField]) ? blockJson[entrypointField] : [blockJson[entrypointField]])
145
145
  .filter(originalValue => typeof originalValue === 'string')
@@ -181,6 +181,9 @@ function resolveEntryFromDirectory(commonConfig, srcRoot, dest) {
181
181
  continue;
182
182
  }
183
183
  const { type, locations, flags } = parsedFilename;
184
+ if (((type === 'script-module') !== processingModules)) {
185
+ continue;
186
+ }
184
187
  let entrypointField;
185
188
  if (Object.keys(locations).length === 2) {
186
189
  if (type === 'script-module') {
@@ -486,6 +486,9 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
486
486
  const { bundleAnalyzer, assumeGlobalizedPlauditLibraries, externalize } = currentBatch[0].dest;
487
487
  const { plugins, removeEmptyScriptsPlugin, makeAdditionalDependencyInjectorPlugin } = buildCommonPluginConfig(webpackConfig, config, bundleAnalyzer, assumeGlobalizedPlauditLibraries, externalize);
488
488
  handleDisablingTSCheckerIfNecessary(currentBatch.flatMap(a => a.srcRoots), scriptExtension, plugins);
489
+ const applicableExtensionTest = (name) => {
490
+ return commonConfig.scriptExtension.test(name) || (!processingModules && shared_1.styleExtension.test(name));
491
+ };
489
492
  const contextPath = webpackConfig.context ?? process.cwd();
490
493
  for (const { dest, src, srcIsDirectory, srcRoot } of currentBatch) {
491
494
  let plugin;
@@ -511,7 +514,7 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
511
514
  continue;
512
515
  }
513
516
  if (dirent.isFile()) {
514
- if ((commonConfig.scriptExtension.test(dirent.name) || shared_1.styleExtension.test(dirent.name))) {
517
+ if (applicableExtensionTest(dirent.name)) {
515
518
  const absoluteSrc = (0, common_config_helpers_1.joinPossiblyAbsolutePaths)(srcRoot, dirent.name);
516
519
  const extensionId = (0, node_path_1.parse)(dirent.name).name;
517
520
  rawEntrypoints.push([(0, node_path_1.join)(dest.destination, (0, node_path_1.basename)(absoluteSrc, (0, node_path_1.extname)(absoluteSrc))), {
@@ -521,7 +524,7 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
521
524
  }
522
525
  }
523
526
  else if (dirent.isDirectory()) {
524
- rawEntrypoints.push(...await walkExtensionsTree((0, node_path_1.join)(srcRoot, dirent.name), dest, [dirent.name]));
527
+ rawEntrypoints.push(...await walkExtensionsTree((0, node_path_1.join)(srcRoot, dirent.name), dest, applicableExtensionTest, [dirent.name]));
525
528
  }
526
529
  }
527
530
  return Object.fromEntries(rawEntrypoints);
@@ -533,10 +536,8 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
533
536
  }
534
537
  else if (sourceType === "plain" /* SourceType.plain */) {
535
538
  const absoluteSrc = typeof srcRoot === 'string' ? srcRoot : srcRoot[0];
536
- if (!srcIsDirectory) {
537
- if (!scriptExtension.test(absoluteSrc) && !shared_1.styleExtension.test(absoluteSrc)) {
538
- continue;
539
- }
539
+ if (!srcIsDirectory && !applicableExtensionTest(absoluteSrc)) {
540
+ continue;
540
541
  }
541
542
  const baseDest = stripExtension(dest.destination);
542
543
  if (config.plainEntrypointsVersion > 1) {
@@ -574,13 +575,16 @@ function processIndividualWebpackConfig(config, webpackConfig, sources, canClean
574
575
  return (0, common_config_helpers_1.commonMakeWebpackConfig)(config, commonConfig, webpackConfig, externalize, plugins, canClean && batches.length < 2);
575
576
  }).filter(cfg => cfg !== undefined);
576
577
  }
577
- async function walkExtensionsTree(srcRoot, dest, parents) {
578
+ async function walkExtensionsTree(srcRoot, dest, applicableExtensionTest, parents) {
578
579
  const res = [];
579
580
  for await (const dirent of await (0, promises_1.opendir)(srcRoot)) {
580
581
  if (dirent.name.startsWith("~")) {
581
582
  continue;
582
583
  }
583
584
  if (dirent.isFile()) {
585
+ if (!applicableExtensionTest(dirent.name)) {
586
+ continue;
587
+ }
584
588
  const parsedFilename = (0, location_encoding_filename_parser_1.parseLocationEncodingFilename)(dirent.name);
585
589
  if (parsedFilename === undefined) {
586
590
  continue;
@@ -608,7 +612,7 @@ async function walkExtensionsTree(srcRoot, dest, parents) {
608
612
  }]);
609
613
  }
610
614
  else if (dirent.isDirectory()) {
611
- res.push(...await walkExtensionsTree((0, node_path_1.join)(srcRoot, dirent.name), dest, [...parents, dirent.name]));
615
+ res.push(...await walkExtensionsTree((0, node_path_1.join)(srcRoot, dirent.name), dest, applicableExtensionTest, [...parents, dirent.name]));
612
616
  }
613
617
  }
614
618
  return res;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plaudit/webpack-extensions",
3
- "version": "2.92.0",
3
+ "version": "2.92.1",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "files": [
6
6
  "/dist",
@@ -66,8 +66,8 @@
66
66
  "postcss-property-lookup": "^3.0.0",
67
67
  "postcss-reporter": "^7.1.0",
68
68
  "postcss-simple-vars": "^7.0.1",
69
- "postcss-url": "^10.1.3",
70
- "webpack": "^5.107.0",
69
+ "postcss-url": "^10.1.4",
70
+ "webpack": "^5.107.1",
71
71
  "webpack-remove-empty-scripts": "^1.1.1",
72
72
  "xml-formatter": "^3.7.0"
73
73
  },