You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.2 KiB
58 lines
1.2 KiB
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
|
|
function _react() {
|
|
const data = _interopRequireDefault(require("react"));
|
|
|
|
_react = function _react() {
|
|
return data;
|
|
};
|
|
|
|
return data;
|
|
}
|
|
|
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
|
|
// data come from https://caniuse.com/#search=intl
|
|
// you can find all browsers in https://github.com/browserslist/browserslist#browsers
|
|
const polyfillTargets = {
|
|
ie: 10,
|
|
firefox: 28,
|
|
chrome: 23,
|
|
safari: 9.1,
|
|
opera: 12.1,
|
|
ios: 9.3,
|
|
ios_saf: 9.3,
|
|
operamini: Infinity,
|
|
op_mini: Infinity,
|
|
android: 4.3,
|
|
blackberry: Infinity,
|
|
operamobile: 12.1,
|
|
op_mob: 12.1,
|
|
explorermobil: 10,
|
|
ie_mob: 10,
|
|
ucandroid: Infinity
|
|
};
|
|
|
|
function isNeedPolyfill(targets = {}) {
|
|
return Object.keys(targets).find(key => {
|
|
const lowKey = key.toLocaleLowerCase();
|
|
return polyfillTargets[lowKey] && polyfillTargets[lowKey] >= targets[key];
|
|
}) !== undefined;
|
|
}
|
|
|
|
var _default = ({
|
|
api
|
|
}) => {
|
|
api.addPolyfillImports(() => {
|
|
return isNeedPolyfill(api.config.targets) ? [{
|
|
source: require.resolve('intl')
|
|
}] : [];
|
|
});
|
|
};
|
|
|
|
exports.default = _default; |