Przeglądaj źródła

Optimizing the build process with dropping support for es5.

Naotoshi Fujita 2 lat temu
rodzic
commit
50a595b478

+ 1 - 1
dist/css/splide-core.min.css

@@ -1 +1 @@
-@keyframes splide-loading{0%{transform:rotate(0)}to{transform:rotate(1turn)}}.splide__track--draggable{-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0!important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:-ms-flexbox;display:flex;height:100%;margin:0!important;padding:0!important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-pack:center;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;-ms-flex-negative:0;flex-shrink:0;list-style-type:none!important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s linear infinite;border:2px solid #999;border-left-color:transparent;border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{clip:rect(0 0 0 0);border:0;height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle.is-active .splide__toggle__play,.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}
+@keyframes splide-loading{0%{transform:rotateZ(0)}100%{transform:rotateZ(360deg)}}.splide__track--draggable{-webkit-touch-callout:none;user-select:none}.splide__track--fade>.splide__list>.splide__slide{margin:0 !important;opacity:0;z-index:0}.splide__track--fade>.splide__list>.splide__slide.is-active{opacity:1;z-index:1}.splide--rtl{direction:rtl}.splide__track--ttb>.splide__list{display:block}.splide__container{box-sizing:border-box;position:relative}.splide__list{backface-visibility:hidden;display:flex;height:100%;margin:0 !important;padding:0 !important}.splide.is-initialized:not(.is-active) .splide__list{display:block}.splide__pagination{align-items:center;display:flex;flex-wrap:wrap;justify-content:center;margin:0;pointer-events:none}.splide__pagination li{display:inline-block;line-height:1;list-style-type:none;margin:0;pointer-events:auto}.splide:not(.is-overflow) .splide__pagination{display:none}.splide__progress__bar{width:0}.splide{position:relative;visibility:hidden}.splide.is-initialized,.splide.is-rendered{visibility:visible}.splide__slide{backface-visibility:hidden;box-sizing:border-box;flex-shrink:0;list-style-type:none !important;margin:0;position:relative}.splide__slide img{vertical-align:bottom}.splide__spinner{animation:splide-loading 1s infinite linear;border:2px solid #999;border-left-color:rgba(0,0,0,0);border-radius:50%;bottom:0;contain:strict;display:inline-block;height:20px;left:0;margin:auto;position:absolute;right:0;top:0;width:20px}.splide__sr{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.splide__toggle__pause{display:none}.splide__toggle.is-active .splide__toggle__play{display:none}.splide__toggle.is-active .splide__toggle__pause{display:inline}.splide__track{overflow:hidden;position:relative;z-index:0}

Plik diff jest za duży
+ 0 - 0
dist/css/splide.min.css


Plik diff jest za duży
+ 0 - 0
dist/css/themes/splide-default.min.css


Plik diff jest za duży
+ 0 - 0
dist/css/themes/splide-sea-green.min.css


Plik diff jest za duży
+ 0 - 0
dist/css/themes/splide-skyblue.min.css


Plik diff jest za duży
+ 0 - 0
dist/js/splide-renderer.min.js


Plik diff jest za duży
+ 0 - 0
dist/js/splide-renderer.min.js.map


Plik diff jest za duży
+ 295 - 375
dist/js/splide.cjs.js


Plik diff jest za duży
+ 293 - 372
dist/js/splide.esm.js


Plik diff jest za duży
+ 289 - 367
dist/js/splide.js


Plik diff jest za duży
+ 0 - 1
dist/js/splide.min.js


BIN
dist/js/splide.min.js.gz


Plik diff jest za duży
+ 0 - 0
dist/js/splide.min.js.map


+ 0 - 372
dist/js/utils/splide-utils.cjs.js

@@ -1,372 +0,0 @@
-'use strict';
-
-Object.defineProperty(exports, '__esModule', { value: true });
-
-function empty(array) {
-  array.length = 0;
-}
-
-function slice(arrayLike, start, end) {
-  return Array.prototype.slice.call(arrayLike, start, end);
-}
-
-function find(arrayLike, predicate) {
-  return slice(arrayLike).filter(predicate)[0];
-}
-
-function apply(func) {
-  return func.bind(null, ...slice(arguments, 1));
-}
-
-const nextTick = setTimeout;
-
-const noop = () => {
-};
-
-function raf(func) {
-  return requestAnimationFrame(func);
-}
-
-function typeOf(type, subject) {
-  return typeof subject === type;
-}
-function isObject(subject) {
-  return !isNull(subject) && typeOf("object", subject);
-}
-const isArray = Array.isArray;
-const isFunction = apply(typeOf, "function");
-const isString = apply(typeOf, "string");
-const isUndefined = apply(typeOf, "undefined");
-function isNull(subject) {
-  return subject === null;
-}
-function isHTMLElement(subject) {
-  try {
-    return subject instanceof (subject.ownerDocument.defaultView || window).HTMLElement;
-  } catch (e) {
-    return false;
-  }
-}
-
-function toArray(value) {
-  return isArray(value) ? value : [value];
-}
-
-function forEach(values, iteratee) {
-  toArray(values).forEach(iteratee);
-}
-
-function includes(array, value) {
-  return array.indexOf(value) > -1;
-}
-
-function push(array, items) {
-  array.push(...toArray(items));
-  return array;
-}
-
-function toggleClass(elm, classes, add) {
-  if (elm) {
-    forEach(classes, (name) => {
-      if (name) {
-        elm.classList[add ? "add" : "remove"](name);
-      }
-    });
-  }
-}
-
-function addClass(elm, classes) {
-  toggleClass(elm, isString(classes) ? classes.split(" ") : classes, true);
-}
-
-function append(parent, children) {
-  forEach(children, parent.appendChild.bind(parent));
-}
-
-function before(nodes, ref) {
-  forEach(nodes, (node) => {
-    const parent = (ref || node).parentNode;
-    if (parent) {
-      parent.insertBefore(node, ref);
-    }
-  });
-}
-
-function matches(elm, selector) {
-  return isHTMLElement(elm) && (elm["msMatchesSelector"] || elm.matches).call(elm, selector);
-}
-
-function children(parent, selector) {
-  const children2 = parent ? slice(parent.children) : [];
-  return selector ? children2.filter((child) => matches(child, selector)) : children2;
-}
-
-function child(parent, selector) {
-  return selector ? children(parent, selector)[0] : parent.firstElementChild;
-}
-
-const ownKeys = Object.keys;
-
-function forOwn(object, iteratee, right) {
-  if (object) {
-    (right ? ownKeys(object).reverse() : ownKeys(object)).forEach((key) => {
-      key !== "__proto__" && iteratee(object[key], key);
-    });
-  }
-  return object;
-}
-
-function assign(object) {
-  slice(arguments, 1).forEach((source) => {
-    forOwn(source, (value, key) => {
-      object[key] = source[key];
-    });
-  });
-  return object;
-}
-
-function merge(object) {
-  slice(arguments, 1).forEach((source) => {
-    forOwn(source, (value, key) => {
-      if (isArray(value)) {
-        object[key] = value.slice();
-      } else if (isObject(value)) {
-        object[key] = merge({}, isObject(object[key]) ? object[key] : {}, value);
-      } else {
-        object[key] = value;
-      }
-    });
-  });
-  return object;
-}
-
-function omit(object, keys) {
-  forEach(keys || ownKeys(object), (key) => {
-    delete object[key];
-  });
-}
-
-function removeAttribute(elms, attrs) {
-  forEach(elms, (elm) => {
-    forEach(attrs, (attr) => {
-      elm && elm.removeAttribute(attr);
-    });
-  });
-}
-
-function setAttribute(elms, attrs, value) {
-  if (isObject(attrs)) {
-    forOwn(attrs, (value2, name) => {
-      setAttribute(elms, name, value2);
-    });
-  } else {
-    forEach(elms, (elm) => {
-      isNull(value) || value === "" ? removeAttribute(elm, attrs) : elm.setAttribute(attrs, String(value));
-    });
-  }
-}
-
-function create(tag, attrs, parent) {
-  const elm = document.createElement(tag);
-  if (attrs) {
-    isString(attrs) ? addClass(elm, attrs) : setAttribute(elm, attrs);
-  }
-  parent && append(parent, elm);
-  return elm;
-}
-
-function style(elm, prop, value) {
-  if (isUndefined(value)) {
-    return getComputedStyle(elm)[prop];
-  }
-  if (!isNull(value)) {
-    elm.style[prop] = `${value}`;
-  }
-}
-
-function display(elm, display2) {
-  style(elm, "display", display2);
-}
-
-function focus(elm) {
-  elm["setActive"] && elm["setActive"]() || elm.focus({ preventScroll: true });
-}
-
-function getAttribute(elm, attr) {
-  return elm.getAttribute(attr);
-}
-
-function hasClass(elm, className) {
-  return elm && elm.classList.contains(className);
-}
-
-function rect(target) {
-  return target.getBoundingClientRect();
-}
-
-function remove(nodes) {
-  forEach(nodes, (node) => {
-    if (node && node.parentNode) {
-      node.parentNode.removeChild(node);
-    }
-  });
-}
-
-function measure(parent, value) {
-  if (isString(value)) {
-    const div = create("div", { style: `width: ${value}; position: absolute;` }, parent);
-    value = rect(div).width;
-    remove(div);
-  }
-  return value;
-}
-
-function parseHtml(html) {
-  return child(new DOMParser().parseFromString(html, "text/html").body);
-}
-
-function prevent(e, stopPropagation) {
-  e.preventDefault();
-  if (stopPropagation) {
-    e.stopPropagation();
-    e.stopImmediatePropagation();
-  }
-}
-
-function query(parent, selector) {
-  return parent && parent.querySelector(selector);
-}
-
-function queryAll(parent, selector) {
-  return selector ? slice(parent.querySelectorAll(selector)) : [];
-}
-
-function removeClass(elm, classes) {
-  toggleClass(elm, classes, false);
-}
-
-function timeOf(e) {
-  return e.timeStamp;
-}
-
-function unit(value) {
-  return isString(value) ? value : value ? `${value}px` : "";
-}
-
-const PROJECT_CODE = "splide";
-
-function assert(condition, message) {
-  if (!condition) {
-    throw new Error(`[${PROJECT_CODE}] ${message || ""}`);
-  }
-}
-
-function error(message) {
-  console.error(`[${PROJECT_CODE}] ${message}`);
-}
-
-const { min, max, floor, ceil, abs } = Math;
-
-function approximatelyEqual(x, y, epsilon) {
-  return abs(x - y) < epsilon;
-}
-
-function between(number, x, y, exclusive) {
-  const minimum = min(x, y);
-  const maximum = max(x, y);
-  return exclusive ? minimum < number && number < maximum : minimum <= number && number <= maximum;
-}
-
-function clamp(number, x, y) {
-  const minimum = min(x, y);
-  const maximum = max(x, y);
-  return min(max(minimum, number), maximum);
-}
-
-function sign(x) {
-  return +(x > 0) - +(x < 0);
-}
-
-function camelToKebab(string) {
-  return string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
-}
-
-function format(string, replacements) {
-  forEach(replacements, (replacement) => {
-    string = string.replace("%s", `${replacement}`);
-  });
-  return string;
-}
-
-function pad(number) {
-  return number < 10 ? `0${number}` : `${number}`;
-}
-
-const ids = {};
-function uniqueId(prefix) {
-  return `${prefix}${pad(ids[prefix] = (ids[prefix] || 0) + 1)}`;
-}
-
-exports.abs = abs;
-exports.addClass = addClass;
-exports.append = append;
-exports.apply = apply;
-exports.approximatelyEqual = approximatelyEqual;
-exports.assert = assert;
-exports.assign = assign;
-exports.before = before;
-exports.between = between;
-exports.camelToKebab = camelToKebab;
-exports.ceil = ceil;
-exports.child = child;
-exports.children = children;
-exports.clamp = clamp;
-exports.create = create;
-exports.display = display;
-exports.empty = empty;
-exports.error = error;
-exports.find = find;
-exports.floor = floor;
-exports.focus = focus;
-exports.forEach = forEach;
-exports.forOwn = forOwn;
-exports.format = format;
-exports.getAttribute = getAttribute;
-exports.hasClass = hasClass;
-exports.includes = includes;
-exports.isArray = isArray;
-exports.isFunction = isFunction;
-exports.isHTMLElement = isHTMLElement;
-exports.isNull = isNull;
-exports.isObject = isObject;
-exports.isString = isString;
-exports.isUndefined = isUndefined;
-exports.matches = matches;
-exports.max = max;
-exports.measure = measure;
-exports.merge = merge;
-exports.min = min;
-exports.nextTick = nextTick;
-exports.noop = noop;
-exports.omit = omit;
-exports.ownKeys = ownKeys;
-exports.pad = pad;
-exports.parseHtml = parseHtml;
-exports.prevent = prevent;
-exports.push = push;
-exports.query = query;
-exports.queryAll = queryAll;
-exports.raf = raf;
-exports.rect = rect;
-exports.remove = remove;
-exports.removeAttribute = removeAttribute;
-exports.removeClass = removeClass;
-exports.setAttribute = setAttribute;
-exports.sign = sign;
-exports.slice = slice;
-exports.style = style;
-exports.timeOf = timeOf;
-exports.toArray = toArray;
-exports.toggleClass = toggleClass;
-exports.uniqueId = uniqueId;
-exports.unit = unit;

+ 0 - 306
dist/js/utils/splide-utils.esm.js

@@ -1,306 +0,0 @@
-function empty(array) {
-  array.length = 0;
-}
-
-function slice(arrayLike, start, end) {
-  return Array.prototype.slice.call(arrayLike, start, end);
-}
-
-function find(arrayLike, predicate) {
-  return slice(arrayLike).filter(predicate)[0];
-}
-
-function apply(func) {
-  return func.bind(null, ...slice(arguments, 1));
-}
-
-const nextTick = setTimeout;
-
-const noop = () => {
-};
-
-function raf(func) {
-  return requestAnimationFrame(func);
-}
-
-function typeOf(type, subject) {
-  return typeof subject === type;
-}
-function isObject(subject) {
-  return !isNull(subject) && typeOf("object", subject);
-}
-const isArray = Array.isArray;
-const isFunction = apply(typeOf, "function");
-const isString = apply(typeOf, "string");
-const isUndefined = apply(typeOf, "undefined");
-function isNull(subject) {
-  return subject === null;
-}
-function isHTMLElement(subject) {
-  try {
-    return subject instanceof (subject.ownerDocument.defaultView || window).HTMLElement;
-  } catch (e) {
-    return false;
-  }
-}
-
-function toArray(value) {
-  return isArray(value) ? value : [value];
-}
-
-function forEach(values, iteratee) {
-  toArray(values).forEach(iteratee);
-}
-
-function includes(array, value) {
-  return array.indexOf(value) > -1;
-}
-
-function push(array, items) {
-  array.push(...toArray(items));
-  return array;
-}
-
-function toggleClass(elm, classes, add) {
-  if (elm) {
-    forEach(classes, (name) => {
-      if (name) {
-        elm.classList[add ? "add" : "remove"](name);
-      }
-    });
-  }
-}
-
-function addClass(elm, classes) {
-  toggleClass(elm, isString(classes) ? classes.split(" ") : classes, true);
-}
-
-function append(parent, children) {
-  forEach(children, parent.appendChild.bind(parent));
-}
-
-function before(nodes, ref) {
-  forEach(nodes, (node) => {
-    const parent = (ref || node).parentNode;
-    if (parent) {
-      parent.insertBefore(node, ref);
-    }
-  });
-}
-
-function matches(elm, selector) {
-  return isHTMLElement(elm) && (elm["msMatchesSelector"] || elm.matches).call(elm, selector);
-}
-
-function children(parent, selector) {
-  const children2 = parent ? slice(parent.children) : [];
-  return selector ? children2.filter((child) => matches(child, selector)) : children2;
-}
-
-function child(parent, selector) {
-  return selector ? children(parent, selector)[0] : parent.firstElementChild;
-}
-
-const ownKeys = Object.keys;
-
-function forOwn(object, iteratee, right) {
-  if (object) {
-    (right ? ownKeys(object).reverse() : ownKeys(object)).forEach((key) => {
-      key !== "__proto__" && iteratee(object[key], key);
-    });
-  }
-  return object;
-}
-
-function assign(object) {
-  slice(arguments, 1).forEach((source) => {
-    forOwn(source, (value, key) => {
-      object[key] = source[key];
-    });
-  });
-  return object;
-}
-
-function merge(object) {
-  slice(arguments, 1).forEach((source) => {
-    forOwn(source, (value, key) => {
-      if (isArray(value)) {
-        object[key] = value.slice();
-      } else if (isObject(value)) {
-        object[key] = merge({}, isObject(object[key]) ? object[key] : {}, value);
-      } else {
-        object[key] = value;
-      }
-    });
-  });
-  return object;
-}
-
-function omit(object, keys) {
-  forEach(keys || ownKeys(object), (key) => {
-    delete object[key];
-  });
-}
-
-function removeAttribute(elms, attrs) {
-  forEach(elms, (elm) => {
-    forEach(attrs, (attr) => {
-      elm && elm.removeAttribute(attr);
-    });
-  });
-}
-
-function setAttribute(elms, attrs, value) {
-  if (isObject(attrs)) {
-    forOwn(attrs, (value2, name) => {
-      setAttribute(elms, name, value2);
-    });
-  } else {
-    forEach(elms, (elm) => {
-      isNull(value) || value === "" ? removeAttribute(elm, attrs) : elm.setAttribute(attrs, String(value));
-    });
-  }
-}
-
-function create(tag, attrs, parent) {
-  const elm = document.createElement(tag);
-  if (attrs) {
-    isString(attrs) ? addClass(elm, attrs) : setAttribute(elm, attrs);
-  }
-  parent && append(parent, elm);
-  return elm;
-}
-
-function style(elm, prop, value) {
-  if (isUndefined(value)) {
-    return getComputedStyle(elm)[prop];
-  }
-  if (!isNull(value)) {
-    elm.style[prop] = `${value}`;
-  }
-}
-
-function display(elm, display2) {
-  style(elm, "display", display2);
-}
-
-function focus(elm) {
-  elm["setActive"] && elm["setActive"]() || elm.focus({ preventScroll: true });
-}
-
-function getAttribute(elm, attr) {
-  return elm.getAttribute(attr);
-}
-
-function hasClass(elm, className) {
-  return elm && elm.classList.contains(className);
-}
-
-function rect(target) {
-  return target.getBoundingClientRect();
-}
-
-function remove(nodes) {
-  forEach(nodes, (node) => {
-    if (node && node.parentNode) {
-      node.parentNode.removeChild(node);
-    }
-  });
-}
-
-function measure(parent, value) {
-  if (isString(value)) {
-    const div = create("div", { style: `width: ${value}; position: absolute;` }, parent);
-    value = rect(div).width;
-    remove(div);
-  }
-  return value;
-}
-
-function parseHtml(html) {
-  return child(new DOMParser().parseFromString(html, "text/html").body);
-}
-
-function prevent(e, stopPropagation) {
-  e.preventDefault();
-  if (stopPropagation) {
-    e.stopPropagation();
-    e.stopImmediatePropagation();
-  }
-}
-
-function query(parent, selector) {
-  return parent && parent.querySelector(selector);
-}
-
-function queryAll(parent, selector) {
-  return selector ? slice(parent.querySelectorAll(selector)) : [];
-}
-
-function removeClass(elm, classes) {
-  toggleClass(elm, classes, false);
-}
-
-function timeOf(e) {
-  return e.timeStamp;
-}
-
-function unit(value) {
-  return isString(value) ? value : value ? `${value}px` : "";
-}
-
-const PROJECT_CODE = "splide";
-
-function assert(condition, message) {
-  if (!condition) {
-    throw new Error(`[${PROJECT_CODE}] ${message || ""}`);
-  }
-}
-
-function error(message) {
-  console.error(`[${PROJECT_CODE}] ${message}`);
-}
-
-const { min, max, floor, ceil, abs } = Math;
-
-function approximatelyEqual(x, y, epsilon) {
-  return abs(x - y) < epsilon;
-}
-
-function between(number, x, y, exclusive) {
-  const minimum = min(x, y);
-  const maximum = max(x, y);
-  return exclusive ? minimum < number && number < maximum : minimum <= number && number <= maximum;
-}
-
-function clamp(number, x, y) {
-  const minimum = min(x, y);
-  const maximum = max(x, y);
-  return min(max(minimum, number), maximum);
-}
-
-function sign(x) {
-  return +(x > 0) - +(x < 0);
-}
-
-function camelToKebab(string) {
-  return string.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
-}
-
-function format(string, replacements) {
-  forEach(replacements, (replacement) => {
-    string = string.replace("%s", `${replacement}`);
-  });
-  return string;
-}
-
-function pad(number) {
-  return number < 10 ? `0${number}` : `${number}`;
-}
-
-const ids = {};
-function uniqueId(prefix) {
-  return `${prefix}${pad(ids[prefix] = (ids[prefix] || 0) + 1)}`;
-}
-
-export { abs, addClass, append, apply, approximatelyEqual, assert, assign, before, between, camelToKebab, ceil, child, children, clamp, create, display, empty, error, find, floor, focus, forEach, forOwn, format, getAttribute, hasClass, includes, isArray, isFunction, isHTMLElement, isNull, isObject, isString, isUndefined, matches, max, measure, merge, min, nextTick, noop, omit, ownKeys, pad, parseHtml, prevent, push, query, queryAll, raf, rect, remove, removeAttribute, removeClass, setAttribute, sign, slice, style, timeOf, toArray, toggleClass, uniqueId, unit };

Plik diff jest za duży
+ 82 - 1242
package-lock.json


+ 6 - 24
package.json

@@ -29,24 +29,15 @@
     "url": "https://github.com/Splidejs/splide/issues"
   },
   "devDependencies": {
-    "@babel/core": "^7.18.13",
-    "@babel/preset-env": "^7.18.10",
-    "@rollup/plugin-babel": "^5.3.1",
-    "@rollup/plugin-node-resolve": "^13.3.0",
     "@types/jest": "^29.0.0",
     "@types/node": "^18.7.14",
     "@typescript-eslint/eslint-plugin": "^5.36.1",
     "@typescript-eslint/parser": "^5.36.1",
-    "autoprefixer": "^10.4.8",
-    "babel-jest": "^29.0.1",
-    "babel-loader": "^8.2.5",
     "chokidar": "^3.5.3",
-    "cssnano": "^5.1.13",
     "esbuild": "^0.15.6",
     "eslint": "^8.23.0",
-    "jest": "^29.0.1",
-    "jest-environment-jsdom": "^29.0.1",
-    "postcss": "^8.4.16",
+    "jest": "^29.1.1",
+    "jest-environment-jsdom": "^29.1.1",
     "rollup": "^2.79.0",
     "rollup-plugin-dts": "^4.2.2",
     "rollup-plugin-esbuild": "^4.10.1",
@@ -55,7 +46,7 @@
     "stylelint-config-sass-guidelines": "^9.0.1",
     "stylelint-order": "^5.0.0",
     "stylelint-scss": "^4.3.0",
-    "ts-jest": "next",
+    "ts-jest": "^29.0.2",
     "tslib": "^2.4.0",
     "typescript": "^4.8.2",
     "uglify-js": "^3.17.0"
@@ -66,7 +57,7 @@
     "build:module": "node scripts/build-module.js",
     "build:types": "node scripts/build-types.js",
     "build:css": "node scripts/build-css.js",
-    "build:all": "npm run build:js && npm run build:module && npm run build:css && npm run build:types && node scripts/build-utils.js",
+    "build:all": "npm run build:js && npm run build:module && npm run build:css && npm run build:types",
     "check:types": "tsc --noEmit",
     "jest": "jest --clearCache && jest",
     "eslint": "eslint src",
@@ -74,20 +65,11 @@
     "beforecommit": "npm run eslint && npm run stylelint && npm run jest && npm run build:all"
   },
   "browserslist": [
-    "> 5%",
-    "ie 10"
+    "> 5%"
   ],
   "files": [
     "dist",
-    "src/css/",
-    "src/js/components",
-    "src/js/constants",
-    "src/js/constructors",
-    "src/js/core",
-    "src/js/renderer",
-    "src/js/transitions",
-    "src/js/types",
-    "src/js/utils"
+    "src/css/"
   ],
   "exports": {
     ".": {

+ 13 - 27
scripts/build-css.js

@@ -1,10 +1,7 @@
-const sass         = require( 'sass' );
-const fs           = require( 'fs' ).promises;
-const path         = require( 'path' );
-const postcss      = require( 'postcss' );
-const cssnano      = require( 'cssnano' );
-const autoprefixer = require( 'autoprefixer' );
-const name         = 'splide';
+const sass = require( 'sass' );
+const fs   = require( 'fs' ).promises;
+const path = require( 'path' );
+const name = 'splide';
 
 const files = [
   './src/css/core/index.scss',
@@ -13,28 +10,17 @@ const files = [
   './src/css/themes/skyblue/index.scss',
 ];
 
-function buildCss( file ) {
-  const result  = sass.renderSync( { file, outputStyle: 'compressed' } );
+async function buildCss( file ) {
+  const result  = await sass.compileAsync( file, { style: 'compressed' } );
   const outFile = rename( file );
 
-  return postcss( [
-    cssnano( { reduceIdents: false } ),
-    autoprefixer(),
-  ] )
-    .process( result.css, { from: undefined } )
-    .then( result => {
-      result.warnings().forEach( warn => {
-        console.warn( warn.toString() );
-      } );
-
-      return fs.writeFile( outFile, result.css ).then( () => result );
-    } )
-    .then( result => {
-      if ( outFile.includes( 'splide-default' ) ) {
-        const dir = path.dirname( outFile ).split( '/' ).slice( 0, -1 ).join( '/' );
-        return fs.writeFile( `${ dir }/${ name }.min.css`, result.css ).then( () => result );
-      }
-    } );
+  await fs.mkdir( './dist/css/themes', { recursive: true } );
+  await fs.writeFile( outFile, result.css );
+
+  if ( outFile.includes( 'splide-default' ) ) {
+    const dir = path.dirname( outFile ).split( '/' ).slice( 0, -1 ).join( '/' );
+    await fs.writeFile( `${ dir }/${ name }.min.css`, result.css );
+  }
 }
 
 function rename( file ) {

+ 0 - 8
scripts/build-module.js

@@ -1,9 +1,6 @@
 const rollup  = require( 'rollup' ).rollup;
-const resolve = require( '@rollup/plugin-node-resolve' ).nodeResolve;
 const esbuild = require( 'rollup-plugin-esbuild' ).default;
 const banner  = require( './constants/banner' );
-const babel   = require( '@rollup/plugin-babel' );
-const path    = require( 'path' );
 const name    = 'splide';
 
 
@@ -11,12 +8,7 @@ function buildModule( type ) {
   return rollup( {
     input: './src/js/index.ts',
     plugins: [
-      resolve(),
       esbuild(),
-      babel.getBabelOutputPlugin( {
-        configFile: path.resolve( __dirname, '../.babelrc' ),
-        allowAllFormats: true,
-      } ),
     ],
   } ).then( bundle => {
     return bundle.write( {

+ 0 - 7
scripts/build-script.js

@@ -1,7 +1,5 @@
 const rollup  = require( 'rollup' ).rollup;
 const esbuild = require( 'rollup-plugin-esbuild' ).default;
-const babel   = require( '@rollup/plugin-babel' );
-const resolve = require( '@rollup/plugin-node-resolve' ).nodeResolve;
 const path    = require( 'path' );
 const minify  = require( './plugins/minify' ).minify;
 const banner  = require( './constants/banner' );
@@ -16,12 +14,7 @@ async function buildScript( compress, type = 'default' ) {
   const bundle = await rollup( {
     input: `./src/js/build/${ type }.ts`,
     plugins: [
-      resolve(),
       esbuild( { minify: false } ),
-      babel.getBabelOutputPlugin( {
-        configFile: path.resolve( __dirname, '../.babelrc' ),
-        allowAllFormats: true,
-      } ),
       compress ? minify() : false,
     ],
   } );

+ 0 - 22
scripts/build-utils.js

@@ -1,22 +0,0 @@
-const rollup  = require( 'rollup' ).rollup;
-const esbuild = require( 'rollup-plugin-esbuild' ).default;
-const name    = 'splide-utils';
-
-
-function buildModule( type ) {
-  return rollup( {
-    input: './src/js/utils/index.ts',
-    plugins: [
-      esbuild(),
-    ],
-  } ).then( bundle => {
-    return bundle.write( {
-      file     : `./dist/js/utils/${ name }.${ type }.js`,
-      format   : type,
-      sourcemap: false,
-      exports  : 'named',
-    } );
-  } );
-}
-
-Promise.all( [ buildModule( 'cjs' ), buildModule( 'esm' ) ] ).catch( e => console.error( e ) );

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików