@shopgate/webpack 7.23.5-beta.6 → 7.23.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopgate/webpack",
3
- "version": "7.23.5-beta.6",
3
+ "version": "7.23.5",
4
4
  "description": "The webpack configuration for Shopgate's Engage.",
5
5
  "main": "webpack.config.js",
6
6
  "license": "Apache-2.0",
@@ -1,3 +1,11 @@
1
+ /* eslint-disable import/extensions, require-jsdoc, no-void, no-param-reassign,
2
+ prefer-destructuring, no-underscore-dangle, consistent-return, no-mixed-operators,
3
+ eslint-comments/no-unlimited-disable, prefer-rest-params, max-len */
4
+ /**
5
+ * Replacement of a sub-module of the Swiper library.
6
+ * Contains some refactored code inside the elementIsChildOfSlot function to remove optional
7
+ * chaining which causes issues with webpack.
8
+ */
1
9
  import { a as getWindow, g as getDocument } from 'swiper/shared/ssr-window.esm.mjs';
2
10
 
3
11
  function classesToTokens(classes) {
@@ -199,6 +207,8 @@ function elementIsChildOfSlot(el, slot) {
199
207
  if (el === elementToCheck) {
200
208
  return true;
201
209
  }
210
+
211
+ // !!!! Rewrote this code to remove optional chaining syntax
202
212
  elementsQueue.push(
203
213
  ...elementToCheck.children,
204
214
  ...(elementToCheck.shadowRoot && elementToCheck.shadowRoot.children ? elementToCheck.shadowRoot.children : []),
@@ -332,4 +342,6 @@ export {
332
342
  elementParents as a, elementOffset as b, createElement as c, now as d, elementChildren as e, elementOuterSize as f, getSlideTransformEl as g, elementIndex as h, classesToTokens as i, getTranslate as j, elementTransitionEnd as k, isObject as l, makeElementsArray as m, nextTick as n, getRotateFix as o, elementStyle as p, elementNextAll as q, elementPrevAll as r, setCSSProperty as s, animateCSSModeScroll as t, showWarning as u, elementIsChildOf as v, extend as w, deleteProps as x,
333
343
  };
334
344
 
335
- /* eslint-enable */
345
+ /* eslint-enable import/extensions, require-jsdoc, no-void, no-param-reassign,
346
+ prefer-destructuring, no-underscore-dangle, consistent-return, no-mixed-operators,
347
+ eslint-comments/no-unlimited-disable, prefer-rest-params, max-len */
package/webpack.config.js CHANGED
@@ -74,6 +74,18 @@ const config = {
74
74
  plugins: [
75
75
  new ShopgateThemeConfigValidatorPlugin(),
76
76
  new ShopgateIndexerPlugin(),
77
+ /**
78
+ * Workaround to enable latest swiper version (11.2.1) with webpack.
79
+ * The utils.mjs file in swiper/shared/utils.mjs is not compatible with webpack due to use of
80
+ * optional chaining.
81
+ *
82
+ * Processing the module with babel-loader doesn't work, since transpilation of some array
83
+ * operations break the module logic inside the browser.
84
+ *
85
+ * As a workaround we replace the file with a local patched version.
86
+ * Alternative approaches e.g. via patch-package didn't work as expected due to issues in
87
+ * release process.
88
+ */
77
89
  new webpack.NormalModuleReplacementPlugin(
78
90
  /swiper\/shared\/utils\.mjs$/,
79
91
  path.resolve(__dirname, 'patches', 'swiper', 'shared', 'utils.mjs')