matchheight 0.1.2 → 0.2.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.
@@ -0,0 +1,5 @@
1
+ declare const MatchHeight: {
2
+ init(): void;
3
+ update(): void;
4
+ };
5
+ export default MatchHeight;
@@ -7,118 +7,91 @@
7
7
  (function (global, factory) {
8
8
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
9
9
  typeof define === 'function' && define.amd ? define(factory) :
10
- (global.MatchHeight = factory());
11
- }(this, (function () { 'use strict';
12
-
13
- function throttle(fn, threshhold) {
14
-
15
- var last = void 0,
16
- deferTimer = void 0;
17
-
18
- return function () {
19
-
20
- var now = Date.now();
21
-
22
- if (last && now < last + threshhold) {
23
-
24
- clearTimeout(deferTimer);
25
- deferTimer = setTimeout(function () {
26
-
27
- last = now;
28
- fn();
29
- }, threshhold);
30
- } else {
31
-
32
- last = now;
33
- fn();
34
- }
35
- };
10
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.MatchHeight = factory());
11
+ })(this, (function () { 'use strict';
12
+
13
+ function throttle(fn, threshold) {
14
+ var last, deferTimer;
15
+ return function () {
16
+ var now = Date.now();
17
+ if (last && now < last + threshold) {
18
+ clearTimeout(deferTimer);
19
+ deferTimer = setTimeout(function () {
20
+ last = now;
21
+ fn();
22
+ }, threshold);
23
+ }
24
+ else {
25
+ last = now;
26
+ fn();
27
+ }
28
+ };
36
29
  }
37
30
 
38
- var errorThreshold = 1; // in px
31
+ var errorThreshold = 1;
39
32
  var initialized = false;
40
- var elements = void 0;
41
- var remains = void 0;
42
-
43
- var MatchHeight$1 = {
44
- init: function init() {
45
-
46
- initialized = true;
47
- elements = document.querySelectorAll('[data-mh]');
48
- MatchHeight$1.update();
49
- },
50
- update: function update() {
51
-
52
- if (!initialized) {
53
-
54
- MatchHeight$1.init();
55
- return;
56
- }
57
-
58
- if (elements.length === 0) return;
59
-
60
- remains = Array.prototype.map.call(elements, function (el) {
61
-
62
- return { el: el };
63
- });
64
- // remove all height before
65
- remains.forEach(function (item) {
66
-
67
- item.el.style.minHeight = '';
68
- });
69
- process();
70
- }
33
+ var elements;
34
+ var remains;
35
+ var MatchHeight = {
36
+ init: function () {
37
+ initialized = true;
38
+ elements = document.querySelectorAll('[data-mh]');
39
+ MatchHeight.update();
40
+ },
41
+ update: function () {
42
+ if (!initialized) {
43
+ MatchHeight.init();
44
+ return;
45
+ }
46
+ if (elements.length === 0)
47
+ return;
48
+ remains = Array.prototype.map.call(elements, function (el) {
49
+ return {
50
+ el: el,
51
+ top: 0,
52
+ height: 0,
53
+ };
54
+ });
55
+ remains.forEach(function (item) {
56
+ item.el.style.minHeight = '';
57
+ });
58
+ process();
59
+ }
71
60
  };
72
-
73
61
  function process() {
74
-
75
- remains.forEach(function (item) {
76
-
77
- var bb = item.el.getBoundingClientRect();
78
-
79
- item.top = bb.top;
80
- item.height = bb.height;
81
- });
82
-
83
- remains.sort(function (a, b) {
84
- return a.top - b.top;
85
- });
86
-
87
- var processingTop = remains[0].top;
88
- var processingTargets = remains.filter(function (item) {
89
- return Math.abs(item.top - processingTop) <= errorThreshold;
90
- });
91
- var maxHeightInRow = Math.max.apply(Math, processingTargets.map(function (item) {
92
- return item.height;
93
- }));
94
-
95
- processingTargets.forEach(function (item) {
96
-
97
- var error = processingTop - item.top + errorThreshold;
98
- var paddingAndBorder = parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-top'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-bottom'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-top-width'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-bottom-width'), 10);
99
- item.el.style.minHeight = maxHeightInRow - paddingAndBorder + error + 'px';
100
- });
101
-
102
- remains.splice(0, processingTargets.length);
103
-
104
- if (0 < remains.length) process();
62
+ remains.forEach(function (item) {
63
+ var bb = item.el.getBoundingClientRect();
64
+ item.top = bb.top;
65
+ item.height = bb.height;
66
+ });
67
+ remains.sort(function (a, b) { return a.top - b.top; });
68
+ var processingTop = remains[0].top;
69
+ var processingTargets = remains.filter(function (item) { return Math.abs(item.top - processingTop) <= errorThreshold; });
70
+ var maxHeightInRow = Math.max.apply(Math, processingTargets.map(function (item) { return item.height; }));
71
+ processingTargets.forEach(function (item) {
72
+ var error = processingTop - item.top + errorThreshold;
73
+ var paddingAndBorder = parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-top')) +
74
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-bottom')) +
75
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-top-width')) +
76
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-bottom-width'));
77
+ item.el.style.minHeight = "".concat(maxHeightInRow - paddingAndBorder + error, "px");
78
+ });
79
+ remains.splice(0, processingTargets.length);
80
+ if (0 < remains.length)
81
+ process();
105
82
  }
106
83
 
107
- var throttledUpdate = throttle(MatchHeight$1.update, 200);
108
-
84
+ var throttledUpdate = throttle(MatchHeight.update, 200);
109
85
  window.addEventListener('DOMContentLoaded', function onDomReady() {
110
-
111
- MatchHeight$1.init();
112
- window.removeEventListener('DOMContentLoaded', onDomReady);
86
+ MatchHeight.init();
87
+ window.removeEventListener('DOMContentLoaded', onDomReady);
113
88
  });
114
89
  window.addEventListener('load', function onLoad() {
115
-
116
- MatchHeight$1.update();
117
- window.removeEventListener('load', onLoad);
90
+ MatchHeight.update();
91
+ window.removeEventListener('load', onLoad);
118
92
  });
119
-
120
93
  window.addEventListener('resize', throttledUpdate);
121
94
 
122
- return MatchHeight$1;
95
+ return MatchHeight;
123
96
 
124
- })));
97
+ }));
@@ -4,4 +4,4 @@
4
4
  * https://github.com/yomotsu/MatchHeight
5
5
  * Released under the MIT License.
6
6
  */
7
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.MatchHeight=e()}(this,function(){"use strict";function t(){i.forEach(function(t){var e=t.el.getBoundingClientRect();t.top=e.top,t.height=e.height}),i.sort(function(t,e){return t.top-e.top});var o=i[0].top,n=i.filter(function(t){return Math.abs(t.top-o)<=e}),r=Math.max.apply(Math,n.map(function(t){return t.height}));n.forEach(function(t){var n=o-t.top+e,i=parseFloat(window.getComputedStyle(t.el).getPropertyValue("padding-top"),10)+parseFloat(window.getComputedStyle(t.el).getPropertyValue("padding-bottom"),10)+parseFloat(window.getComputedStyle(t.el).getPropertyValue("border-top-width"),10)+parseFloat(window.getComputedStyle(t.el).getPropertyValue("border-bottom-width"),10);t.el.style.minHeight=r-i+n+"px"}),i.splice(0,n.length),0<i.length&&t()}var e=1,o=!1,n=void 0,i=void 0,r={init:function(){o=!0,n=document.querySelectorAll("[data-mh]"),r.update()},update:function(){if(!o)return void r.init();0!==n.length&&(i=Array.prototype.map.call(n,function(t){return{el:t}}),i.forEach(function(t){t.el.style.minHeight=""}),t())}},d=function(t,e){var o=void 0,n=void 0;return function(){var i=Date.now();o&&i<o+e?(clearTimeout(n),n=setTimeout(function(){o=i,t()},e)):(o=i,t())}}(r.update,200);return window.addEventListener("DOMContentLoaded",function t(){r.init(),window.removeEventListener("DOMContentLoaded",t)}),window.addEventListener("load",function t(){r.update(),window.removeEventListener("load",t)}),window.addEventListener("resize",d),r});
7
+ (function(global,factory){typeof exports==="object"&&typeof module!=="undefined"?module.exports=factory():typeof define==="function"&&define.amd?define(factory):(global=typeof globalThis!=="undefined"?globalThis:global||self,global.MatchHeight=factory())})(this,(function(){"use strict";function throttle(fn,threshold){var last,deferTimer;return function(){var now=Date.now();if(last&&now<last+threshold){clearTimeout(deferTimer);deferTimer=setTimeout((function(){last=now;fn()}),threshold)}else{last=now;fn()}}}var errorThreshold=1;var initialized=false;var elements;var remains;var MatchHeight={init:function(){initialized=true;elements=document.querySelectorAll("[data-mh]");MatchHeight.update()},update:function(){if(!initialized){MatchHeight.init();return}if(elements.length===0)return;remains=Array.prototype.map.call(elements,(function(el){return{el:el,top:0,height:0}}));remains.forEach((function(item){item.el.style.minHeight=""}));process()}};function process(){remains.forEach((function(item){var bb=item.el.getBoundingClientRect();item.top=bb.top;item.height=bb.height}));remains.sort((function(a,b){return a.top-b.top}));var processingTop=remains[0].top;var processingTargets=remains.filter((function(item){return Math.abs(item.top-processingTop)<=errorThreshold}));var maxHeightInRow=Math.max.apply(Math,processingTargets.map((function(item){return item.height})));processingTargets.forEach((function(item){var error=processingTop-item.top+errorThreshold;var paddingAndBorder=parseFloat(window.getComputedStyle(item.el).getPropertyValue("padding-top"))+parseFloat(window.getComputedStyle(item.el).getPropertyValue("padding-bottom"))+parseFloat(window.getComputedStyle(item.el).getPropertyValue("border-top-width"))+parseFloat(window.getComputedStyle(item.el).getPropertyValue("border-bottom-width"));item.el.style.minHeight="".concat(maxHeightInRow-paddingAndBorder+error,"px")}));remains.splice(0,processingTargets.length);if(0<remains.length)process()}var throttledUpdate=throttle(MatchHeight.update,200);window.addEventListener("DOMContentLoaded",(function onDomReady(){MatchHeight.init();window.removeEventListener("DOMContentLoaded",onDomReady)}));window.addEventListener("load",(function onLoad(){MatchHeight.update();window.removeEventListener("load",onLoad)}));window.addEventListener("resize",throttledUpdate);return MatchHeight}));
@@ -4,113 +4,86 @@
4
4
  * https://github.com/yomotsu/MatchHeight
5
5
  * Released under the MIT License.
6
6
  */
7
- function throttle(fn, threshhold) {
8
-
9
- var last = void 0,
10
- deferTimer = void 0;
11
-
12
- return function () {
13
-
14
- var now = Date.now();
15
-
16
- if (last && now < last + threshhold) {
17
-
18
- clearTimeout(deferTimer);
19
- deferTimer = setTimeout(function () {
20
-
21
- last = now;
22
- fn();
23
- }, threshhold);
24
- } else {
25
-
26
- last = now;
27
- fn();
28
- }
29
- };
7
+ function throttle(fn, threshold) {
8
+ var last, deferTimer;
9
+ return function () {
10
+ var now = Date.now();
11
+ if (last && now < last + threshold) {
12
+ clearTimeout(deferTimer);
13
+ deferTimer = setTimeout(function () {
14
+ last = now;
15
+ fn();
16
+ }, threshold);
17
+ }
18
+ else {
19
+ last = now;
20
+ fn();
21
+ }
22
+ };
30
23
  }
31
24
 
32
- var errorThreshold = 1; // in px
25
+ var errorThreshold = 1;
33
26
  var initialized = false;
34
- var elements = void 0;
35
- var remains = void 0;
36
-
37
- var MatchHeight$1 = {
38
- init: function init() {
39
-
40
- initialized = true;
41
- elements = document.querySelectorAll('[data-mh]');
42
- MatchHeight$1.update();
43
- },
44
- update: function update() {
45
-
46
- if (!initialized) {
47
-
48
- MatchHeight$1.init();
49
- return;
50
- }
51
-
52
- if (elements.length === 0) return;
53
-
54
- remains = Array.prototype.map.call(elements, function (el) {
55
-
56
- return { el: el };
57
- });
58
- // remove all height before
59
- remains.forEach(function (item) {
60
-
61
- item.el.style.minHeight = '';
62
- });
63
- process();
64
- }
27
+ var elements;
28
+ var remains;
29
+ var MatchHeight = {
30
+ init: function () {
31
+ initialized = true;
32
+ elements = document.querySelectorAll('[data-mh]');
33
+ MatchHeight.update();
34
+ },
35
+ update: function () {
36
+ if (!initialized) {
37
+ MatchHeight.init();
38
+ return;
39
+ }
40
+ if (elements.length === 0)
41
+ return;
42
+ remains = Array.prototype.map.call(elements, function (el) {
43
+ return {
44
+ el: el,
45
+ top: 0,
46
+ height: 0,
47
+ };
48
+ });
49
+ remains.forEach(function (item) {
50
+ item.el.style.minHeight = '';
51
+ });
52
+ process();
53
+ }
65
54
  };
66
-
67
55
  function process() {
68
-
69
- remains.forEach(function (item) {
70
-
71
- var bb = item.el.getBoundingClientRect();
72
-
73
- item.top = bb.top;
74
- item.height = bb.height;
75
- });
76
-
77
- remains.sort(function (a, b) {
78
- return a.top - b.top;
79
- });
80
-
81
- var processingTop = remains[0].top;
82
- var processingTargets = remains.filter(function (item) {
83
- return Math.abs(item.top - processingTop) <= errorThreshold;
84
- });
85
- var maxHeightInRow = Math.max.apply(Math, processingTargets.map(function (item) {
86
- return item.height;
87
- }));
88
-
89
- processingTargets.forEach(function (item) {
90
-
91
- var error = processingTop - item.top + errorThreshold;
92
- var paddingAndBorder = parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-top'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-bottom'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-top-width'), 10) + parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-bottom-width'), 10);
93
- item.el.style.minHeight = maxHeightInRow - paddingAndBorder + error + 'px';
94
- });
95
-
96
- remains.splice(0, processingTargets.length);
97
-
98
- if (0 < remains.length) process();
56
+ remains.forEach(function (item) {
57
+ var bb = item.el.getBoundingClientRect();
58
+ item.top = bb.top;
59
+ item.height = bb.height;
60
+ });
61
+ remains.sort(function (a, b) { return a.top - b.top; });
62
+ var processingTop = remains[0].top;
63
+ var processingTargets = remains.filter(function (item) { return Math.abs(item.top - processingTop) <= errorThreshold; });
64
+ var maxHeightInRow = Math.max.apply(Math, processingTargets.map(function (item) { return item.height; }));
65
+ processingTargets.forEach(function (item) {
66
+ var error = processingTop - item.top + errorThreshold;
67
+ var paddingAndBorder = parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-top')) +
68
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('padding-bottom')) +
69
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-top-width')) +
70
+ parseFloat(window.getComputedStyle(item.el).getPropertyValue('border-bottom-width'));
71
+ item.el.style.minHeight = "".concat(maxHeightInRow - paddingAndBorder + error, "px");
72
+ });
73
+ remains.splice(0, processingTargets.length);
74
+ if (0 < remains.length)
75
+ process();
99
76
  }
100
77
 
101
- var throttledUpdate = throttle(MatchHeight$1.update, 200);
102
-
78
+ var throttledUpdate = throttle(MatchHeight.update, 200);
103
79
  window.addEventListener('DOMContentLoaded', function onDomReady() {
104
-
105
- MatchHeight$1.init();
106
- window.removeEventListener('DOMContentLoaded', onDomReady);
80
+ MatchHeight.init();
81
+ window.removeEventListener('DOMContentLoaded', onDomReady);
107
82
  });
108
83
  window.addEventListener('load', function onLoad() {
109
-
110
- MatchHeight$1.update();
111
- window.removeEventListener('load', onLoad);
84
+ MatchHeight.update();
85
+ window.removeEventListener('load', onLoad);
112
86
  });
113
-
114
87
  window.addEventListener('resize', throttledUpdate);
115
88
 
116
- export default MatchHeight$1;
89
+ export { MatchHeight as default };
package/dist/main.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import MatchHeight from './MatchHeight.js';
2
+ export default MatchHeight;
@@ -0,0 +1,2 @@
1
+ declare function throttle(fn: () => void, threshold: number): () => void;
2
+ export default throttle;
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "matchheight",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "author": "Yomotsu",
5
5
  "license": "MIT",
6
- "main": "dist/MatchHeight.js",
7
6
  "repository": "yomotsu/MatchHeight",
7
+ "main": "dist/MatchHeight.js",
8
8
  "jsnext:main": "dist/MatchHeight.module.js",
9
9
  "module": "dist/MatchHeight.module.js",
10
+ "types": "dist/MatchHeight.d.ts",
10
11
  "devDependencies": {
11
- "babel-preset-env": "1.2.2",
12
- "rollup": "^0.41.4",
13
- "rollup-plugin-babel": "2.7.1",
14
- "rollup-watch": "^3.2.2",
15
- "uglify-js": "^2.6.0"
12
+ "@rollup/plugin-typescript": "^11.0.0",
13
+ "rollup": "^3.16.0",
14
+ "terser": "^5.16.4",
15
+ "tslib": "^2.5.0",
16
+ "typescript": "^4.9.5"
16
17
  },
17
18
  "scripts": {
18
19
  "dev": "rollup --config --watch",
19
- "build": "rollup --config",
20
- "release": "rollup --config && uglifyjs dist/MatchHeight.js -cm --preamble \"/*!\n * @author yomotsu\n * MatchHeight\n * https://github.com/yomotsu/MatchHeight\n * Released under the MIT License.\n */\" > dist/MatchHeight.min.js"
20
+ "build": "rollup --config && terser dist/MatchHeight.js -o dist/MatchHeight.min.js --comments '/^!/'"
21
21
  },
22
22
  "keywords": [
23
23
  "matchHeight",
@@ -0,0 +1,32 @@
1
+ import pkg from './package.json' assert { type: "json" };
2
+ import typescript from 'typescript';
3
+ import rollupTypescript from '@rollup/plugin-typescript';
4
+
5
+ const license = `/*!
6
+ * @author yomotsu
7
+ * MatchHeight
8
+ * https://github.com/yomotsu/MatchHeight
9
+ * Released under the MIT License.
10
+ */`;
11
+
12
+ export default {
13
+ input: './src/main.ts',
14
+ output: [
15
+ {
16
+ format: 'umd',
17
+ name: 'MatchHeight',
18
+ file: pkg.main,
19
+ banner: license,
20
+ indent: '\t',
21
+ },
22
+ {
23
+ format: 'es',
24
+ file: pkg.module,
25
+ banner: license,
26
+ indent: '\t',
27
+ }
28
+ ],
29
+ plugins: [
30
+ rollupTypescript( { typescript } ),
31
+ ],
32
+ };
@@ -1,7 +1,13 @@
1
+ type Item = {
2
+ el: HTMLElement;
3
+ top: number;
4
+ height: number;
5
+ }
6
+
1
7
  const errorThreshold = 1; // in px
2
8
  let initialized = false;
3
- let elements;
4
- let remains;
9
+ let elements: NodeListOf<HTMLElement>;
10
+ let remains: Item[];
5
11
 
6
12
  const MatchHeight = {
7
13
 
@@ -24,11 +30,15 @@ const MatchHeight = {
24
30
 
25
31
  if ( elements.length === 0 ) return;
26
32
 
27
- remains = Array.prototype.map.call( elements, ( el ) => {
33
+ remains = Array.prototype.map.call( elements, ( el: HTMLElement ): Item => {
28
34
 
29
- return { el: el };
35
+ return {
36
+ el,
37
+ top: 0,
38
+ height: 0,
39
+ };
30
40
 
31
- } );
41
+ } ) as Item[];
32
42
  // remove all height before
33
43
  remains.forEach( ( item ) => {
34
44
 
@@ -62,10 +72,10 @@ function process() {
62
72
 
63
73
  const error = processingTop - item.top + errorThreshold;
64
74
  const paddingAndBorder =
65
- parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'padding-top' ), 10 ) +
66
- parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'padding-bottom' ), 10 ) +
67
- parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'border-top-width' ), 10 ) +
68
- parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'border-bottom-width' ), 10 );
75
+ parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'padding-top' ) ) +
76
+ parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'padding-bottom' ) ) +
77
+ parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'border-top-width' ) ) +
78
+ parseFloat( window.getComputedStyle( item.el ).getPropertyValue( 'border-bottom-width' ) );
69
79
  item.el.style.minHeight = `${ maxHeightInRow - paddingAndBorder + error }px`;
70
80
 
71
81
  } );
File without changes
@@ -1,12 +1,12 @@
1
- function throttle( fn, threshhold ) {
1
+ function throttle( fn: () => void, threshold: number ) {
2
2
 
3
- let last, deferTimer;
3
+ let last: number, deferTimer: number;
4
4
 
5
5
  return function () {
6
6
 
7
7
  const now = Date.now();
8
8
 
9
- if ( last && now < last + threshhold ) {
9
+ if ( last && now < last + threshold ) {
10
10
 
11
11
  clearTimeout( deferTimer );
12
12
  deferTimer = setTimeout( function () {
@@ -14,7 +14,7 @@ function throttle( fn, threshhold ) {
14
14
  last = now;
15
15
  fn();
16
16
 
17
- }, threshhold );
17
+ }, threshold );
18
18
 
19
19
  } else {
20
20
 
package/tsconfig.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "compilerOptions": {
3
+ "baseUrl": "src",
4
+ "outDir": "./dist",
5
+ "declaration": true,
6
+ "target": "es5",
7
+ "strict": true,
8
+ "removeComments": true,
9
+ "experimentalDecorators": true,
10
+ "noImplicitAny": true,
11
+ "noImplicitThis": true,
12
+ "noImplicitReturns": true,
13
+ "noUnusedLocals": true,
14
+ "noUnusedParameters": true,
15
+ "strictNullChecks": true,
16
+ "strictFunctionTypes": true,
17
+ "noFallthroughCasesInSwitch": true
18
+ },
19
+ "include": ["src/**/*"],
20
+ "exclude": ["node_modules"]
21
+ }
package/rollup.config.js DELETED
@@ -1,44 +0,0 @@
1
- import babel from 'rollup-plugin-babel'
2
-
3
- const license = `/*!
4
- * @author yomotsu
5
- * MatchHeight
6
- * https://github.com/yomotsu/MatchHeight
7
- * Released under the MIT License.
8
- */`
9
-
10
- export default {
11
- entry: './src/main.js',
12
- indent: '\t',
13
- sourceMap: false,
14
- plugins: [
15
- babel( {
16
- exclude: 'node_modules/**',
17
- presets: [
18
- [ 'env', {
19
- targets: {
20
- browsers: [
21
- 'last 2 versions',
22
- 'ie >= 9'
23
- ]
24
- },
25
- loose: true,
26
- modules: false
27
- } ]
28
- ]
29
- } )
30
- ],
31
- targets: [
32
- {
33
- format: 'umd',
34
- moduleName: 'MatchHeight',
35
- dest: 'dist/MatchHeight.js',
36
- banner: license
37
- },
38
- {
39
- format: 'es',
40
- dest: 'dist/MatchHeight.module.js',
41
- banner: license
42
- }
43
- ]
44
- };