mvertopoulos / vue-msal

Vue plugin for using Microsoft Authentication Library (MSAL)
MIT License
123 stars 66 forks source link

Set target to 'ES5', use lib 'es2015' and 'dom'. Fixes IE11 class issue #12

Closed maspling closed 4 years ago

maspling commented 4 years ago

With only target set to ES2015 the code does not transpile the class keyword. Causing a Syntax Error in IE11.

This small PR changes the target to ES5 and adds the libs to keep the project functioning.

Pre change dist/plugin.js:

...
const mixin_1 = require("./mixin");
exports.msalMixin = mixin_1.mixin;
class msalPlugin {
    static install(Vue, options) {
        Vue.prototype.$msal = new msalPlugin(options, Vue);
    }
    constructor(options, Vue = undefined) {
        const msal = new main_1.MSAL(options);
        if (Vue && options.framework && options.framework.globalMixin) {
            Vue.mixin(mixin_1.mixin);
        }
...

Post change dist/plugin.js:

...
var main_1 = require("./src/main");
var mixin_1 = require("./mixin");
exports.msalMixin = mixin_1.mixin;
var msalPlugin = /** @class */ (function () {
    function msalPlugin(options, Vue) {
        if (Vue === void 0) { Vue = undefined; }
        var msal = new main_1.MSAL(options);
        if (Vue && options.framework && options.framework.globalMixin) {
            Vue.mixin(mixin_1.mixin);
        }
...

Thank you for your considerations and hope we can get IE11 compatibility again :)

maspling commented 4 years ago

Hi, feel free to contact me if there is anything I need to consider or look at!

smintman commented 4 years ago

Please accept this pull request need to get this working on IE 11

mvertopoulos commented 4 years ago

Hi! Sorry for the long delay. Releasing the fix on npm now.

Thanks for the help.