weboptimizer 2.0.1470 → 2.0.1472

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/eslint.config.mjs CHANGED
@@ -78,6 +78,7 @@ export default [js.configs.recommended, ...typescript.configs.recommended, jsdoc
78
78
  'jsdoc/require-param': 'error',
79
79
  'jsdoc/require-param-description': 'error',
80
80
  'jsdoc/require-param-type': 'off',
81
+ 'jsdoc/require-property-type': 'off',
81
82
  'jsdoc/require-returns-description': 'error',
82
83
  'jsdoc/require-returns-type': 'off',
83
84
  'jsdoc/tag-lines': ['error', 'never'],
package/helper.d.ts CHANGED
@@ -184,12 +184,13 @@ export declare class Helper {
184
184
  * Determines all module file paths.
185
185
  * @param buildConfigurations - Resolved build configuration.
186
186
  * @param moduleFilePathsToExclude - A list of modules file paths to
187
- * exclude (specified by path or id) or a mapping from chunk names to
188
- * module ids.
187
+ * exclude (specified by path or id).
188
+ * @param moduleFilePathPatternToExclude - A list of modules file paths
189
+ * pattern to exclude (specified by path or id).
189
190
  * @param context - File path to use as starting point.
190
191
  * @returns All determined module file paths.
191
192
  */
192
- static getAutoInjection(this: void, buildConfigurations: ResolvedBuildConfiguration, moduleFilePathsToExclude: Array<string>, context: string): Mapping;
193
+ static getAutoInjection(this: void, buildConfigurations: ResolvedBuildConfiguration, moduleFilePathsToExclude: Array<string>, moduleFilePathPatternToExclude: Array<RegExp | string>, context: string): Mapping;
193
194
  /**
194
195
  * Determines a resolved module file path in given package path.
195
196
  * @param packagePath - Path to package to resolve in.
package/helper.js CHANGED
@@ -614,7 +614,7 @@ var Helper = exports.Helper = /*#__PURE__*/function () {
614
614
  var referencePath = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
615
615
  var pathsToIgnore = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : ['.git'];
616
616
  var injection = _clientnode["default"].copy(givenInjection);
617
- var moduleFilePathsToExclude = Helper.determineModuleLocations(givenInjection.autoExclude, aliases, moduleReplacements, {
617
+ var moduleFilePathsToExclude = Helper.determineModuleLocations(givenInjection.autoExclude.paths, aliases, moduleReplacements, {
618
618
  file: extensions.file.internal
619
619
  }, context, referencePath, pathsToIgnore).filePaths;
620
620
  var _iterator10 = _createForOfIteratorHelper(['entry', 'external']),
@@ -630,7 +630,7 @@ var Helper = exports.Helper = /*#__PURE__*/function () {
630
630
  chunk = _Object$entries4$_i[1];
631
631
  if (chunk === '__auto__') {
632
632
  chunk = injectionType[chunkName] = [];
633
- var modules = Helper.getAutoInjection(buildConfigurations, moduleFilePathsToExclude, referencePath);
633
+ var modules = Helper.getAutoInjection(buildConfigurations, moduleFilePathsToExclude, givenInjection.autoExclude.pattern, referencePath);
634
634
  for (var _i10 = 0, _Object$values5 = Object.values(modules); _i10 < _Object$values5.length; _i10++) {
635
635
  var subChunk = _Object$values5[_i10];
636
636
  chunk.push(subChunk);
@@ -642,7 +642,7 @@ var Helper = exports.Helper = /*#__PURE__*/function () {
642
642
  chunk.reverse();
643
643
  }
644
644
  }
645
- } else if (injectionType === '__auto__') injection[name] = Helper.getAutoInjection(buildConfigurations, moduleFilePathsToExclude, referencePath);
645
+ } else if (injectionType === '__auto__') injection[name] = Helper.getAutoInjection(buildConfigurations, moduleFilePathsToExclude, givenInjection.autoExclude.pattern, referencePath);
646
646
  }
647
647
  } catch (err) {
648
648
  _iterator10.e(err);
@@ -655,14 +655,15 @@ var Helper = exports.Helper = /*#__PURE__*/function () {
655
655
  * Determines all module file paths.
656
656
  * @param buildConfigurations - Resolved build configuration.
657
657
  * @param moduleFilePathsToExclude - A list of modules file paths to
658
- * exclude (specified by path or id) or a mapping from chunk names to
659
- * module ids.
658
+ * exclude (specified by path or id).
659
+ * @param moduleFilePathPatternToExclude - A list of modules file paths
660
+ * pattern to exclude (specified by path or id).
660
661
  * @param context - File path to use as starting point.
661
662
  * @returns All determined module file paths.
662
663
  */
663
664
  }, {
664
665
  key: "getAutoInjection",
665
- value: function getAutoInjection(buildConfigurations, moduleFilePathsToExclude, context) {
666
+ value: function getAutoInjection(buildConfigurations, moduleFilePathsToExclude, moduleFilePathPatternToExclude, context) {
666
667
  var result = {};
667
668
  var injectedModuleIDs = {};
668
669
  var _iterator11 = _createForOfIteratorHelper(buildConfigurations),
@@ -676,7 +677,7 @@ var Helper = exports.Helper = /*#__PURE__*/function () {
676
677
  try {
677
678
  for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
678
679
  var moduleFilePath = _step12.value;
679
- if (!moduleFilePathsToExclude.includes(moduleFilePath)) {
680
+ if (!(moduleFilePathsToExclude.includes(moduleFilePath) || _clientnode["default"].isAnyMatching(moduleFilePath, moduleFilePathPatternToExclude))) {
680
681
  var relativeModuleFilePath = "./".concat((0, _path.relative)(context, moduleFilePath));
681
682
  var directoryPath = (0, _path.dirname)(relativeModuleFilePath);
682
683
  var baseName = (0, _path.basename)(relativeModuleFilePath, ".".concat(buildConfiguration.extension));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weboptimizer",
3
- "version": "2.0.1470",
3
+ "version": "2.0.1472",
4
4
  "description": "A generic web optimizer, (module) bundler and development environment.",
5
5
  "keywords": [
6
6
  "webpack",
@@ -113,7 +113,7 @@
113
113
  "rimraf": "^5.0.7",
114
114
  "script-loader": "^0.7.2",
115
115
  "typescript": "^5.4.5",
116
- "webpack": "^5.91.0",
116
+ "webpack": "^5.92.0",
117
117
  "webpack-cli": "^5.1.4",
118
118
  "webpack-sources": "^3.2.3"
119
119
  },
@@ -130,14 +130,14 @@
130
130
  "@types/postcss-url": "^10.0.4",
131
131
  "@types/webpack-env": "^1.18.5",
132
132
  "@types/webpack-sources": "^3.2.3",
133
- "@typescript-eslint/eslint-plugin": "^7.12.0",
134
- "@typescript-eslint/parser": "^7.12.0",
133
+ "@typescript-eslint/eslint-plugin": "^7.13.0",
134
+ "@typescript-eslint/parser": "^7.13.0",
135
135
  "css-loader": "^7.1.2",
136
136
  "cssnano": "^7.0.2",
137
137
  "documentation-website": "^1.0.326",
138
138
  "eslint": "^9.4.0",
139
139
  "eslint-config-google": "^0.14.0",
140
- "eslint-plugin-jsdoc": "^48.2.9",
140
+ "eslint-plugin-jsdoc": "^48.2.12",
141
141
  "favicons": "^7.2.0",
142
142
  "favicons-webpack-plugin": "^6.0.1",
143
143
  "globals": "^15.4.0",
@@ -159,7 +159,7 @@
159
159
  "stylelint": "^16.6.1",
160
160
  "stylelint-config-standard": "^36.0.0",
161
161
  "stylelint-config-standard-scss": "^13.1.0",
162
- "typescript-eslint": "^7.12.0",
162
+ "typescript-eslint": "^7.13.0",
163
163
  "typescript-plugin-css-modules": "^5.1.0",
164
164
  "workbox-webpack-plugin": "^7.1.0"
165
165
  },
@@ -752,18 +752,25 @@
752
752
  "givenCommandLineArguments": [],
753
753
  "hashAlgorithm": "md5",
754
754
  "injection": {
755
- "autoExclude": [
756
- "./declarations.d.ts",
757
- "./dummy",
758
- "./dummyPlugin",
759
- "./test",
760
- "./test.js",
761
- "./test.ts",
762
- "./type",
763
- "./type.js",
764
- "./type.ts",
765
- ".coverage"
766
- ],
755
+ "autoExclude": {
756
+ "paths": [
757
+ "./declarations.d.ts",
758
+ "./dummy",
759
+ "./dummyPlugin",
760
+ "./test",
761
+ "./test.js",
762
+ "./test.ts",
763
+ "./type",
764
+ "./type.js",
765
+ "./type.ts",
766
+ ".coverage"
767
+ ],
768
+ "pattern": [
769
+ {
770
+ "__evaluate__": "./test/.+"
771
+ }
772
+ ]
773
+ },
767
774
  "chunks": {},
768
775
  "entry": {
769
776
  "index": "__auto__"
package/type.d.ts CHANGED
@@ -45,7 +45,10 @@ export type ExternalAliases = Mapping<Mapping | string | ((_request: string, _ke
45
45
  export type GivenInjection = AnyFunction | string | Array<string> | Mapping<string | Array<string>>;
46
46
  export type NormalizedGivenInjection = Mapping<Array<string>>;
47
47
  export interface GivenInjectionConfiguration {
48
- autoExclude: Array<string>;
48
+ autoExclude: {
49
+ paths: Array<string>;
50
+ pattern: Array<RegExp | string>;
51
+ };
49
52
  entry: GivenInjection;
50
53
  external: GivenInjection;
51
54
  }
@@ -248,7 +248,7 @@ if (configuration.injection.external.modules === '__implicit__')
248
248
  We only want to process modules from local context in library mode,
249
249
  since a concrete project using this library should combine all assets
250
250
  (and de-duplicate them) for optimal bundling results.
251
- NOTE: Only native java script and json modules will be marked as
251
+ NOTE: Only native javascript and json modules will be marked as
252
252
  external dependency.
253
253
  */
254
254
  configuration.injection.external.modules = function (_ref, callback) {