diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 00000000..7802094f --- /dev/null +++ b/.browserslistrc @@ -0,0 +1 @@ +ie 10 diff --git a/lib/util.js b/lib/util.js index a41e6e7b..52c1f70b 100644 --- a/lib/util.js +++ b/lib/util.js @@ -30,12 +30,12 @@ api.IdentifierIssuer = IdentifierIssuer; // from https://github.com/caolan/async/blob/master/lib/async.js // capture the global reference to guard against fakeTimer mocks -const _setImmediate = typeof setImmediate === 'function' && setImmediate; +const _setImmediate = typeof setImmediate === 'function' + // not a direct alias to prevent "Invalid calling object" error in IE and Edge + ? fn => setImmediate(fn) + : undefined; -const _delay = _setImmediate ? - // not a direct alias (for IE10 compatibility) - fn => _setImmediate(fn) : - fn => setTimeout(fn, 0); +const _delay = _setImmediate || (fn => setTimeout(fn, 0)); if(typeof process === 'object' && typeof process.nextTick === 'function') { api.nextTick = process.nextTick; diff --git a/webpack.config.js b/webpack.config.js index da62a315..9dcaf0b8 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -60,13 +60,10 @@ outputs.forEach(info => { rules: [ { test: /\.js$/, - include: [{ - // exclude node_modules by default - exclude: /(node_modules)/ - }, { - // include rdf-canonize - include: /(node_modules\/rdf-canonize)/ - }], + include: [ + path.join(__dirname, 'lib'), + path.join(__dirname, 'node_modules', 'rdf-canonize'), + ], use: { loader: 'babel-loader', options: {