Skip to content
Permalink
Browse files

updated build dependencies

  • Loading branch information...
jackmoore committed Mar 23, 2018
1 parent c025a27 commit 5ee542d7bf6bbb6007c716182dfdac4d35a60e98
Showing with 40 additions and 30 deletions.
  1. +9 −3 build.js
  2. +20 −19 dist/autosize.js
  3. +2 −2 dist/autosize.min.js
  4. +6 −3 package.json
  5. +3 −3 src/autosize.js
@@ -2,7 +2,7 @@ var pkg = require('./package.json');
var fs = require('fs');
var ugly = require('uglify-js');
var jshint = require('jshint').JSHINT;
var babel = require('babel');
var babel = require('babel-core');
var gaze = require('gaze');

function lint(full) {
@@ -14,6 +14,7 @@ function lint(full) {
eqeqeq: true,
eqnull: true,
noarg: true,
immed: false,
predef: ['define', 'module', 'exports', 'Map']
});

@@ -29,7 +30,7 @@ function lint(full) {
}

function build(code) {
var minified = ugly.minify(code, {fromString: true}).code;
var minified = ugly.minify(code).code;
var header = [
`/*!`,
` ${pkg.name} ${pkg.version}`,
@@ -45,7 +46,12 @@ function build(code) {
}

function transform(filepath) {
babel.transformFile(filepath, {modules: 'umd'}, function (err,res) {
babel.transformFile(filepath, {
plugins: [
"add-module-exports", ["transform-es2015-modules-umd", {"strict": true, "noInterop": true}]
],
presets: ["env"],
}, function (err,res) {
if (err) {
return console.log(err);
} else {
@@ -1,24 +1,24 @@
/*!
Autosize 4.0.0
autosize 4.0.0
license: MIT
http://www.jacklmoore.com/autosize
*/
(function (global, factory) {
if (typeof define === 'function' && define.amd) {
define(['exports', 'module'], factory);
} else if (typeof exports !== 'undefined' && typeof module !== 'undefined') {
factory(exports, module);
if (typeof define === "function" && define.amd) {
define(['module', 'exports'], factory);
} else if (typeof exports !== "undefined") {
factory(module, exports);
} else {
var mod = {
exports: {}
};
factory(mod.exports, mod);
factory(mod, mod.exports);
global.autosize = mod.exports;
}
})(this, function (exports, module) {
})(this, function (module, exports) {
'use strict';

var map = typeof Map === "function" ? new Map() : (function () {
var map = typeof Map === "function" ? new Map() : function () {
var keys = [];
var values = [];

@@ -35,15 +35,15 @@
values.push(value);
}
},
'delete': function _delete(key) {
delete: function _delete(key) {
var index = keys.indexOf(key);
if (index > -1) {
keys.splice(index, 1);
values.splice(index, 1);
}
}
};
})();
}();

var createEvent = function createEvent(name) {
return new Event(name, { bubbles: true });
@@ -52,7 +52,7 @@
new Event('test');
} catch (e) {
// IE does not support `new Event()`
createEvent = function (name) {
createEvent = function createEvent(name) {
var evt = document.createEvent('Event');
evt.initEvent(name, true, false);
return evt;
@@ -63,7 +63,7 @@
if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;

var heightOffset = null;
var clientWidth = ta.clientWidth;
var clientWidth = null;
var cachedHeight = null;

function init() {
@@ -160,7 +160,7 @@
// Using offsetHeight as a replacement for computed.height in IE, because IE does not account use of border-box
var actualHeight = computed.boxSizing === 'content-box' ? Math.round(parseFloat(computed.height)) : ta.offsetHeight;

// The actual height not matching the style height (set via the resize method) indicates that
// The actual height not matching the style height (set via the resize method) indicates that
// the max-height has been exceeded, in which case the overflow should be allowed.
if (actualHeight !== styleHeight) {
if (computed.overflowY === 'hidden') {
@@ -195,7 +195,7 @@
}
};

var destroy = (function (style) {
var destroy = function (style) {
window.removeEventListener('resize', pageResize, false);
ta.removeEventListener('input', update, false);
ta.removeEventListener('keyup', update, false);
@@ -206,8 +206,8 @@
ta.style[key] = style[key];
});

map['delete'](ta);
}).bind(ta, {
map.delete(ta);
}.bind(ta, {
height: ta.style.height,
resize: ta.style.resize,
overflowY: ta.style.overflowY,
@@ -256,7 +256,7 @@

// Do nothing in Node.js environment and IE8 (or lower)
if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
autosize = function (el) {
autosize = function autosize(el) {
return el;
};
autosize.destroy = function (el) {
@@ -266,7 +266,7 @@
return el;
};
} else {
autosize = function (el, options) {
autosize = function autosize(el, options) {
if (el) {
Array.prototype.forEach.call(el.length ? el : [el], function (x) {
return assign(x, options);
@@ -288,5 +288,6 @@
};
}

module.exports = autosize;
exports.default = autosize;
module.exports = exports['default'];
});

Some generated files are not rendered by default. Learn more.

@@ -26,10 +26,13 @@
},
"dependencies": {},
"devDependencies": {
"babel": "^5.4.3",
"babel-core": "^6.26.0",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-es2015-modules-umd": "^6.24.1",
"babel-preset-env": "^1.6.1",
"gaze": "^1.1.2",
"jshint": "^2.9.4",
"uglify-js": "^2.7.4"
"jshint": "^2.9.5",
"uglify-js": "^3.3.16"
},
"scripts": {
"build": "node build"
@@ -41,7 +41,7 @@ function assign(ta) {
if (!ta || !ta.nodeName || ta.nodeName !== 'TEXTAREA' || map.has(ta)) return;

let heightOffset = null;
let clientWidth = ta.clientWidth;
let clientWidth = null;
let cachedHeight = null;

function init() {
@@ -173,7 +173,7 @@ function assign(ta) {
}
};

const destroy = style => {
const destroy = (style => {
window.removeEventListener('resize', pageResize, false);
ta.removeEventListener('input', update, false);
ta.removeEventListener('keyup', update, false);
@@ -185,7 +185,7 @@ function assign(ta) {
});

map.delete(ta);
}.bind(ta, {
}).bind(ta, {
height: ta.style.height,
resize: ta.style.resize,
overflowY: ta.style.overflowY,

0 comments on commit 5ee542d

Please sign in to comment.
You can’t perform that action at this time.