So I'm going crazy over this. I have a certain module that I use that is not compatible with IE, and because of that the best option to me seemed to not import after I detect the user is using IE.
I don't know anything about polyfills, so I have no clue how to use them, so I have no clue wether they can be the solution, or are the problem. Regardless, I thought not initiating the animations module would do the trick, but that doesn't seem to work like expected. Even commenting out commands.push(animations) still fires the module in IE.
import './polyfill';
import queue from './helpers/queue';
import navigation from './navigation';
import search from './search';
import animations from './animations';
const init = () => {
document.documentElement.classList.remove('no-js');
const commands = [
navigation,
search,
];
let isIE = false;
const ua = window.navigator.userAgent;
const oldIE = ua.indexOf('MSIE ');
const newIE = ua.indexOf('Trident/');
if (oldIE > -1 || newIE > -1) {
isIE = true;
}
console.log(isIE);
if (!isIE) {
commands.push(animations);
}
queue(commands);
};
window.addEventListener('load', init);
So how can I avoid the animations-module being loaded in IE? I've been trying for hours now, to no avail. Thanks in advance guys!