Currently, I am faced with an interesting challenge. For a forthcoming VueJS project, we must utilize a library that is quite outdated but there is simply not enough time to redevelop it.
The library is essentially a JavaScript file which consists of numerous var declarations, functions, and prototypes.
Its structure resembles the following:
var t1 = 'test1';
var i1 = 2;
function testclass(arg) {
object1 = this;
this._t1 = null;
return object1;
}
testclass.prototype = {
dosth: function () {
console.log('doing');
}
}
However, it spans around 10,399 lines of code making it impossible to refactor into an object or add exports to each function individually.
Do you have any innovative ideas or tools to address this issue? Thus far, our only option would be to import it separately as a script tag, although this approach triggers our linter's complaints and appears rather inelegant.