Skip to content

Commit

Permalink
Do not include IE11 fix by default, let the users import it when needed
Browse files Browse the repository at this point in the history
It addes 20KB to the build, which not everyone needs
  • Loading branch information
alubbe committed May 25, 2020
1 parent a2be5c9 commit 22c3102
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
17 changes: 0 additions & 17 deletions lib/exceljs.browser.js
@@ -1,26 +1,9 @@
/* eslint-disable import/no-extraneous-dependencies,node/no-unpublished-require */
require('core-js/modules/es.promise');
require('core-js/modules/es.string.includes');
require('core-js/modules/es.object.assign');
require('core-js/modules/es.object.keys');
require('regenerator-runtime/runtime');

const rewritePattern = require('regexpu-core');
const {generateRegexpuOptions} = require('@babel/helper-create-regexp-features-plugin/lib/util');

const {RegExp} = global;
try {
RegExp('a', 'u');
} catch (err) {
global.RegExp = function(pattern, flags) {
if (flags && flags.includes('u')) {
return new RegExp(rewritePattern(pattern, flags, generateRegexpuOptions({flags, pattern})));
}
return new RegExp(pattern, flags);
};
global.RegExp.prototype = RegExp;
}

const ExcelJS = {
Workbook: require('./doc/workbook'),
};
Expand Down
2 changes: 0 additions & 2 deletions package.json
Expand Up @@ -106,7 +106,6 @@
"devDependencies": {
"@babel/cli": "^7.6.4",
"@babel/core": "^7.9.0",
"@babel/helper-create-regexp-features-plugin": "^7.8.8",
"@babel/preset-env": "^7.9.5",
"@types/chai": "^4.2.11",
"@types/mocha": "^7.0.2",
Expand Down Expand Up @@ -140,7 +139,6 @@
"prettier-eslint": "^9.0.0",
"prettier-eslint-cli": "^5.0.0",
"regenerator-runtime": "^0.13.5",
"regexpu-core": "^4.7.0",
"ts-node": "^8.9.0",
"typescript": "^3.8.3"
}
Expand Down

0 comments on commit 22c3102

Please sign in to comment.